def firewall(zones=None, interfaces=None, policy=None, rules=None, routestopped=None, masq=None):
 family = distrib_family()
 if (family != 'debian'):
  raise UnsupportedFamily(supported=['debian'])
 require_deb_package('shorewall')
 with watch(CONFIG_FILES) as config:
  _zone_config(zones)
  _interfaces_config(interfaces)
  _policy_config(policy)
  _rules_config(rules)
  _routestopped_config(routestopped)
  _masq_config(masq)
 if config.changed:
  puts('Shorewall configuration changed')
  if is_started():
   restart('shorewall')
 with settings(hide('running'), shell_env()):
  sed('/etc/default/shorewall', 'startup=0', 'startup=1', use_sudo=True)

def firewall ( zones = None , interfaces = None , policy = None , rules = None , routestopped = None , masq = None ) : family = distrib_family ( ) if ( family != 'debian' ) : raise UnsupportedFamily ( supported = [ 'debian' ] ) require_deb_package ( 'shorewall' ) with watch ( CONFIG_FILES ) as config : _zone_config ( zones ) _interfaces_config ( interfaces ) _policy_config ( policy ) _rules_config ( rules ) _routestopped_config ( routestopped ) _masq_config ( masq ) if config . changed : puts ( 'Shorewall configuration changed' ) if is_started ( ) : restart ( 'shorewall' ) with settings ( hide ( 'running' ) , shell_env ( ) ) : sed ( '/etc/default/shorewall' , 'startup=0' , 'startup=1' , use_sudo = True )
ensure that a firewall is configured .