def _format_firewall_stdout(cmd_ret):
 ret_dict = {'success': True, 'rulesets': {}}
 for line in cmd_ret['stdout'].splitlines():
  if line.startswith('Name'):
   continue
  if line.startswith('---'):
   continue
  ruleset_status = line.split()
  ret_dict['rulesets'][ruleset_status[0]] = bool(ruleset_status[1])
 return ret_dict

def _format_firewall_stdout ( cmd_ret ) : ret_dict = { 'success' : True , 'rulesets' : { } } for line in cmd_ret [ 'stdout' ] . splitlines ( ) : if line . startswith ( 'Name' ) : continue if line . startswith ( '---' ) : continue ruleset_status = line . split ( ) ret_dict [ 'rulesets' ] [ ruleset_status [ 0 ] ] = bool ( ruleset_status [ 1 ] ) return ret_dict
helper function to format the stdout from the get_firewall_status function .