diff options
-rw-r--r-- | vio/vio/swagger/views/fakeplugin/fakeData/fakeResponse.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/vio/vio/swagger/views/fakeplugin/fakeData/fakeResponse.py b/vio/vio/swagger/views/fakeplugin/fakeData/fakeResponse.py index c23a1b2..ff9c066 100644 --- a/vio/vio/swagger/views/fakeplugin/fakeData/fakeResponse.py +++ b/vio/vio/swagger/views/fakeplugin/fakeData/fakeResponse.py @@ -3,7 +3,6 @@ from vio.pub.config.config import MSB_SERVICE_PORT from vio.pub.config.config import MSB_SERVICE_IP from collections import defaultdict -from uuid import uuid4 from datetime import datetime from datetime import timedelta import copy @@ -33,7 +32,7 @@ serverMapps[InitialServer] = \ { "name": "new-server-test", "tenantid": Tenantid, - "status": "ACTIVE", + "status": "BUILDING", 'createTime': (datetime.now()).strftime("%Y-%m-%d %H:%M:%S"), "turnStatusTime": datetime.now() } @@ -1636,7 +1635,9 @@ def create_instance(token, json=None): except Exception: return {"error": {"message": "invalidate data", "code": 403}} - uid = str(uuid4()) + # It's safe to using inner vm id, + # Avoid data sharing in multiprocess. + uid = InitialServer data = { "server": { "id": uid, @@ -1678,8 +1679,7 @@ def _serverStatus(serverid): or serverMapps[serverid]['status'] == "BUILDING": serverMapps[serverid]['status'] = "ACTIVE" elif serverMapps[serverid]['status'] == "DELETING": - del serverMapps[serverid] - raise ValueError() + return elif serverMapps[serverid]['status'] == "POWERING_OFF": serverMapps[serverid]['status'] = "SHUTDOWN" elif serverMapps[serverid]['status'] == "POWERING_ON": |