Revision 8d325d4b snf-cyclades-app/synnefo/logic/backend.py

b/snf-cyclades-app/synnefo/logic/backend.py
231 231
    vm.nics.all().delete()
232 232

  
233 233
    for nic in ganeti_nics:
234
        ipv4 = nic.get('ipv4', '')
234
        ipv4 = nic["ipv4"]
235 235
        net = nic['network']
236 236
        if ipv4:
237 237
            net.reserve_address(ipv4)
......
257 257
        net = Network.objects.get(pk=pk)
258 258

  
259 259
        # Get the new nic info
260
        mac = new_nic.get('mac', '')
261
        ipv4 = new_nic.get('ip', '')
262
        if net.subnet6:
263
            ipv6 = mac2eui64(mac, net.subnet6)
264
        else:
265
            ipv6 = ''
266

  
267
        firewall = new_nic.get('firewall', '')
268
        firewall_profile = _reverse_tags.get(firewall, '')
260
        mac = new_nic.get('mac')
261
        ipv4 = new_nic.get('ip')
262
        ipv6 = mac2eui64(mac, net.subnet6) if net.subnet6 is not None else None
263

  
264
        firewall = new_nic.get('firewall')
265
        firewall_profile = _reverse_tags.get(firewall)
269 266
        if not firewall_profile and net.public:
270 267
            firewall_profile = settings.DEFAULT_FIREWALL_PROFILE
271 268

  

Also available in: Unified diff