#NEWLINE# def _routestopped_config( routestopped ) : #NEWLINE# #INDENT# '\n    Routestopped configuration\n\n    This lists the hosts that should be accessible\n    when the firewall is stopped or starting.\n    ' #NEWLINE# if ( routestopped is None ) : #NEWLINE# #INDENT# routestopped = [ ] #NEWLINE# #UNINDENT# lines = [ ROUTESTOPPED_HEADER ] #NEWLINE# for entry in routestopped : #NEWLINE# #INDENT# entry . setdefault ( 'interface' , 'eth0' ) #NEWLINE# entry . setdefault ( 'host' , '0.0.0.0/0' ) #NEWLINE# entry . setdefault ( 'options' , '-' ) #NEWLINE# entry . setdefault ( 'proto' , '-' ) #NEWLINE# entry . setdefault ( 'dest_port' , '-' ) #NEWLINE# entry . setdefault ( 'source_port' , '-' ) #NEWLINE# if isinstance ( entry [ 'host' ] , list ) : #NEWLINE# #INDENT# entry [ 'host' ] = ',' . join ( lines [ 'host' ] ) #NEWLINE# #UNINDENT# if isinstance ( entry [ 'options' ] , list ) : #NEWLINE# #INDENT# entry [ 'options' ] = ',' . join ( entry [ 'options' ] ) #NEWLINE# #UNINDENT# lines . append ( ( ROUTESTOPPED_FORMAT % entry ) ) #NEWLINE# #UNINDENT# file ( '/etc/shorewall/routestopped' , contents = '' . join ( lines ) , use_sudo = True )