def _get_firewall_rules(firewall_rules):
 ret = []
 for (key, value) in firewall_rules.iteritems():
  if ('protocol' not in firewall_rules[key].keys()):
   raise SaltCloudConfigError("The firewall rule '{0}' is missing 'protocol'".format(key))
  ret.append(FirewallRule(name=key, protocol=firewall_rules[key].get('protocol', None), source_mac=firewall_rules[key].get('source_mac', None), source_ip=firewall_rules[key].get('source_ip', None), target_ip=firewall_rules[key].get('target_ip', None), port_range_start=firewall_rules[key].get('port_range_start', None), port_range_end=firewall_rules[key].get('port_range_end', None), icmp_type=firewall_rules[key].get('icmp_type', None), icmp_code=firewall_rules[key].get('icmp_code', None)))
 return ret

def _get_firewall_rules ( firewall_rules ) : ret = [ ] for ( key , value ) in firewall_rules . iteritems ( ) : if ( 'protocol' not in firewall_rules [ key ] . keys ( ) ) : raise SaltCloudConfigError ( "The firewall rule '{0}' is missing 'protocol'" . format ( key ) ) ret . append ( FirewallRule ( name = key , protocol = firewall_rules [ key ] . get ( 'protocol' , None ) , source_mac = firewall_rules [ key ] . get ( 'source_mac' , None ) , source_ip = firewall_rules [ key ] . get ( 'source_ip' , None ) , target_ip = firewall_rules [ key ] . get ( 'target_ip' , None ) , port_range_start = firewall_rules [ key ] . get ( 'port_range_start' , None ) , port_range_end = firewall_rules [ key ] . get ( 'port_range_end' , None ) , icmp_type = firewall_rules [ key ] . get ( 'icmp_type' , None ) , icmp_code = firewall_rules [ key ] . get ( 'icmp_code' , None ) ) ) return ret
construct a list of optional firewall rules from the cloud profile .