Revision c4e45b57 snf-cyclades-app/synnefo/logic/reconciliation.py

b/snf-cyclades-app/synnefo/logic/reconciliation.py
121 121
    idG = set(G.keys())
122 122

  
123 123
    for i in idD & idG:
124
        if (G[i] and D[i] != 'STARTED' or
125
            not G[i] and D[i] not in ('BUILD', 'ERROR', 'STOPPED')):
124
        vm_unsynced = (G[i] and D[i] != "STARTED") or\
125
                      (not G[i] and D[i] not in ('BUILD', 'ERROR', 'STOPPED'))
126
        if vm_unsynced:
126 127
            unsynced.add((i, D[i], G[i]))
127 128
        if not G[i] and D[i] == 'BUILD':
128 129
            vm = VirtualMachine.objects.get(id=i)
......
281 282
        for index in nicsG.keys():
282 283
            nicD = nicsD[index]
283 284
            nicG = nicsG[index]
284
            if (nicD['ipv4'] != nicG['ipv4'] or
285
                nicD['mac'] != nicG['mac'] or
286
                nicD['network'] != nicG['network']):
285
            diff = (nicD['ipv4'] != nicG['ipv4'] or
286
                    nicD['mac'] != nicG['mac'] or
287
                    nicD['network'] != nicG['network'])
288
            if diff:
287 289
                    unsynced[i] = (nicsD, nicsG)
288 290
                    break
289 291

  

Also available in: Unified diff