diff --git a/server/src/uds/services/OpenStack/LiveDeployment.py b/server/src/uds/services/OpenStack/LiveDeployment.py index aeeadda9b..764dba302 100644 --- a/server/src/uds/services/OpenStack/LiveDeployment.py +++ b/server/src/uds/services/OpenStack/LiveDeployment.py @@ -39,8 +39,7 @@ from . import openStack import pickle import logging -__updated__ = '2017-05-17' - +__updated__ = '2017-11-21' logger = logging.getLogger(__name__) @@ -183,8 +182,8 @@ class LiveDeployment(UserDeployment): if status == openStack.PAUSED: self.service().resumeMachine(self._vmid) - elif status == openStack.STOPPED: - self.service().startMachine(self._vmId) + elif status in (openStack.STOPPED, openStack.SHUTOFF): + self.service().startMachine(self._vmid) # Right now, we suppose the machine is ready @@ -385,7 +384,6 @@ class LiveDeployment(UserDeployment): return ret - def __checkStart(self): ''' Checks if machine has started diff --git a/server/src/uds/services/OpenStack/openStack/common.py b/server/src/uds/services/OpenStack/openStack/common.py index 57a5dcf60..d50cb79e7 100644 --- a/server/src/uds/services/OpenStack/openStack/common.py +++ b/server/src/uds/services/OpenStack/openStack/common.py @@ -35,7 +35,7 @@ import re import logging -__updated__ = '2016-03-07' +__updated__ = '2017-11-21' logger = logging.getLogger(__name__) @@ -43,16 +43,18 @@ logger = logging.getLogger(__name__) HARD_REBOOT, MIGRATING, PASSWORD, PAUSED, REBOOT, REBUILD, RESCUED, RESIZED, REVERT_RESIZE, SOFT_DELETED, -STOPPED, SUSPENDED, UNKNOWN, VERIFY_RESIZE) = ('ACTIVE', 'BUILDING', 'DELETED', 'ERROR', +STOPPED, SUSPENDED, UNKNOWN, VERIFY_RESIZE, SHUTOFF) = ('ACTIVE', 'BUILDING', 'DELETED', 'ERROR', 'HARD_REBOOT', 'MIGRATING', 'PASSWORD', 'PAUSED', 'REBOOT', 'REBUILD', 'RESCUED', 'RESIZED', 'REVERT_RESIZE', 'SOFT_DELETED', - 'STOPPED', 'SUSPENDED', 'UNKNOWN', 'VERIFY_RESIZE') + 'STOPPED', 'SUSPENDED', 'UNKNOWN', 'VERIFY_RESIZE', 'SHUTOFF') + # Helpers to check statuses def statusIsLost(status): return status in [DELETED, ERROR, UNKNOWN, SOFT_DELETED] + def sanitizeName(name): ''' machine names with [a-zA-Z0-9_-]