Revision 443315d6 snf-cyclades-app/synnefo/api/servers.py
b/snf-cyclades-app/synnefo/api/servers.py | ||
---|---|---|
105 | 105 |
|
106 | 106 |
|
107 | 107 |
def nic_to_dict(nic): |
108 |
ip_type = "floating" if nic.is_floating_ip else "fixed" |
|
109 | 108 |
d = {'id': util.construct_nic_id(nic), |
110 | 109 |
'network_id': str(nic.network.id), |
111 | 110 |
'mac_address': nic.mac, |
112 | 111 |
'ipv4': nic.ipv4, |
113 | 112 |
'ipv6': nic.ipv6, |
114 |
'OS-EXT-IPS:type': ip_type}
|
|
113 |
'OS-EXT-IPS:type': nic.ip_type.lower()}
|
|
115 | 114 |
|
116 | 115 |
if nic.firewall_profile: |
117 | 116 |
d['firewallProfile'] = nic.firewall_profile |
Also available in: Unified diff