mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-22 13:34:04 +03:00
Fixed SHUTOFF on OpenStack
This commit is contained in:
parent
004acbab9a
commit
e5f0fcce69
@ -39,8 +39,7 @@ from . import openStack
|
|||||||
import pickle
|
import pickle
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
__updated__ = '2017-05-17'
|
__updated__ = '2017-11-21'
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -183,8 +182,8 @@ class LiveDeployment(UserDeployment):
|
|||||||
|
|
||||||
if status == openStack.PAUSED:
|
if status == openStack.PAUSED:
|
||||||
self.service().resumeMachine(self._vmid)
|
self.service().resumeMachine(self._vmid)
|
||||||
elif status == openStack.STOPPED:
|
elif status in (openStack.STOPPED, openStack.SHUTOFF):
|
||||||
self.service().startMachine(self._vmId)
|
self.service().startMachine(self._vmid)
|
||||||
|
|
||||||
# Right now, we suppose the machine is ready
|
# Right now, we suppose the machine is ready
|
||||||
|
|
||||||
@ -385,7 +384,6 @@ class LiveDeployment(UserDeployment):
|
|||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
def __checkStart(self):
|
def __checkStart(self):
|
||||||
'''
|
'''
|
||||||
Checks if machine has started
|
Checks if machine has started
|
||||||
|
@ -35,7 +35,7 @@ import re
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
__updated__ = '2016-03-07'
|
__updated__ = '2017-11-21'
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -43,16 +43,18 @@ logger = logging.getLogger(__name__)
|
|||||||
HARD_REBOOT, MIGRATING, PASSWORD,
|
HARD_REBOOT, MIGRATING, PASSWORD,
|
||||||
PAUSED, REBOOT, REBUILD, RESCUED,
|
PAUSED, REBOOT, REBUILD, RESCUED,
|
||||||
RESIZED, REVERT_RESIZE, SOFT_DELETED,
|
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',
|
'HARD_REBOOT', 'MIGRATING', 'PASSWORD',
|
||||||
'PAUSED', 'REBOOT', 'REBUILD', 'RESCUED',
|
'PAUSED', 'REBOOT', 'REBUILD', 'RESCUED',
|
||||||
'RESIZED', 'REVERT_RESIZE', 'SOFT_DELETED',
|
'RESIZED', 'REVERT_RESIZE', 'SOFT_DELETED',
|
||||||
'STOPPED', 'SUSPENDED', 'UNKNOWN', 'VERIFY_RESIZE')
|
'STOPPED', 'SUSPENDED', 'UNKNOWN', 'VERIFY_RESIZE', 'SHUTOFF')
|
||||||
|
|
||||||
|
|
||||||
# Helpers to check statuses
|
# Helpers to check statuses
|
||||||
def statusIsLost(status):
|
def statusIsLost(status):
|
||||||
return status in [DELETED, ERROR, UNKNOWN, SOFT_DELETED]
|
return status in [DELETED, ERROR, UNKNOWN, SOFT_DELETED]
|
||||||
|
|
||||||
|
|
||||||
def sanitizeName(name):
|
def sanitizeName(name):
|
||||||
'''
|
'''
|
||||||
machine names with [a-zA-Z0-9_-]
|
machine names with [a-zA-Z0-9_-]
|
||||||
|
Loading…
Reference in New Issue
Block a user