def _get_nics(vm_):
 nics = []
 if ('public_lan' in vm_):
  firewall_rules = []
  lan_id = set_public_lan(int(vm_['public_lan']))
  if ('public_firewall_rules' in vm_):
   firewall_rules = _get_firewall_rules(vm_['public_firewall_rules'])
  nics.append(NIC(lan=lan_id, name='public', firewall_rules=firewall_rules))
 if ('private_lan' in vm_):
  firewall_rules = []
  if ('private_firewall_rules' in vm_):
   firewall_rules = _get_firewall_rules(vm_['private_firewall_rules'])
  nic = NIC(lan=int(vm_['private_lan']), name='private', firewall_rules=firewall_rules)
  if ('nat' in vm_):
   nic.nat = vm_['nat']
  nics.append(nic)
 return nics

def _get_nics ( vm_ ) : nics = [ ] if ( 'public_lan' in vm_ ) : firewall_rules = [ ] lan_id = set_public_lan ( int ( vm_ [ 'public_lan' ] ) ) if ( 'public_firewall_rules' in vm_ ) : firewall_rules = _get_firewall_rules ( vm_ [ 'public_firewall_rules' ] ) nics . append ( NIC ( lan = lan_id , name = 'public' , firewall_rules = firewall_rules ) ) if ( 'private_lan' in vm_ ) : firewall_rules = [ ] if ( 'private_firewall_rules' in vm_ ) : firewall_rules = _get_firewall_rules ( vm_ [ 'private_firewall_rules' ] ) nic = NIC ( lan = int ( vm_ [ 'private_lan' ] ) , name = 'private' , firewall_rules = firewall_rules ) if ( 'nat' in vm_ ) : nic . nat = vm_ [ 'nat' ] nics . append ( nic ) return nics
create network interfaces on appropriate lans as defined in cloud profile .