Revision 7fede91e snf-cyclades-app/synnefo/api/servers.py

b/snf-cyclades-app/synnefo/api/servers.py
108 108
    else:
109 109
        return method_not_allowed(request)
110 110

  
111
def nic_to_dict(nic):
112
    network = nic.network
113
    network_id = str(network.id) if not network.public else 'public'
114
    ipv4 = nic.ipv4 if nic.ipv4 else None
115
    ipv6 = nic.ipv6 if nic.ipv6 else None
116 111

  
117
    d = {'id': util.construct_nic_id(nic), 'network_id': network_id, 'mac_address': nic.mac, 'ipv4': ipv4, 'ipv6': ipv6}
112
def nic_to_dict(nic):
113
    d = {'id': util.construct_nic_id(nic),
114
         'network_id': str(nic.network.id),
115
         'mac_address': nic.mac,
116
         'ipv4': nic.ipv4 if nic.ipv4 else None,
117
         'ipv6': nic.ipv6 if nic.ipv6 else None}
118 118
    if nic.firewall_profile:
119 119
        d['firewallProfile'] = nic.firewall_profile
120 120
    return d

Also available in: Unified diff