Revision 5abebfaa api/servers.py

b/api/servers.py
16 16

  
17 17
from logging import getLogger
18 18

  
19
from logic import utils
19 20

  
20 21
log = getLogger('synnefo.api.servers')
21 22
rapi = GanetiRapiClient(*settings.GANETI_CLUSTER_INFO)
......
58 59
def server_to_dict(server, detail=False):
59 60
    d = dict(id=server.id, name=server.name)
60 61
    if detail:
61
        d['status'] = server.rsapi_state
62
        d['progress'] = 100 if server.rsapi_state == 'ACTIVE' else 0
62
        d['status'] = utils.get_rsapi_state(server)
63
        d['progress'] = 100 if utils.get_rsapi_state(server) == 'ACTIVE' else 0
63 64
        d['hostId'] = server.hostid
64 65
        d['updated'] = server.updated.isoformat()
65 66
        d['created'] = server.created.isoformat()

Also available in: Unified diff