* Fixed a bug on oVirt

* Added devel support for "notify ready from os manager"
This commit is contained in:
Adolfo Gómez 2013-07-05 11:06:33 +00:00
parent eb9993f607
commit 0b2e38a85d
2 changed files with 4 additions and 1 deletions

View File

@ -265,7 +265,7 @@ class OVirtLinkedDeployment(UserDeployment):
if self._vmid != '': # Powers off
try:
state = self.service().getMachineState(self._vmid)
if state == 'up' and state == 'suspended':
if state in ('up', 'suspended'):
self.service().stopMachine(self._vmid)
except:
logger.debug('Can\t set machine state to stopped')

View File

@ -165,6 +165,9 @@ def develAction(credentials, action, ids ):
logger.debug('Releasing in use from {0}'.format(uds.friendly_name))
uds.setState(State.USABLE)
uds.setInUse(False)
elif action == 'notifyReady':
logger.debug('Notifying ready from os manager to {0}'.format(uds.friendly_name))
uds.getInstance().osmanager().process(uds, 'ready', '{0}=1.2.3.4'.format(uds.unique_id))
else:
logger.debug('Setting {0} to usable'.format(uds.friendly_name))
uds.setState(State.USABLE)