Revision c4e45b57

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

  
b/snf-cyclades-app/synnefo/logic/utils.py
102 102
    if vm.deleted:
103 103
        return "DELETED"
104 104
    # A machine is in REBOOT if an OP_INSTANCE_REBOOT request is in progress
105
    if r == 'ACTIVE' and vm.backendopcode == 'OP_INSTANCE_REBOOT' and \
106
        vm.backendjobstatus in ('queued', 'waiting', 'running'):
105
    in_reboot = (r == 'ACTIVE') and\
106
                (vm.backendopcode == "OP_INSTANCE_REBOOT") and\
107
                (vm.backendjobstatus in ('queued', 'waiting', 'running'))
108
    if in_reboot:
107 109
        return "REBOOT"
108 110
    return r
109 111

  
b/snf-cyclades-app/synnefo/quotas/util.py
36 36
from synnefo.db.models import VirtualMachine, Network
37 37
from synnefo.quotas import get_quota_holder, NoEntityError
38 38

  
39

  
39 40
def get_db_holdings(users=None):
40 41
    """Get holdings from Cyclades DB."""
41 42
    holdings = {}

Also available in: Unified diff