From 0b2e38a85da5d0805940a902fae37720c265d8a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez?= Date: Fri, 5 Jul 2013 11:06:33 +0000 Subject: [PATCH] * Fixed a bug on oVirt * Added devel support for "notify ready from os manager" --- server/src/uds/services/OVirt/OVirtLinkedDeployment.py | 2 +- server/src/uds/xmlrpc/services/UserDeployedServices.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/uds/services/OVirt/OVirtLinkedDeployment.py b/server/src/uds/services/OVirt/OVirtLinkedDeployment.py index d4a6ef83..63b5080f 100644 --- a/server/src/uds/services/OVirt/OVirtLinkedDeployment.py +++ b/server/src/uds/services/OVirt/OVirtLinkedDeployment.py @@ -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') diff --git a/server/src/uds/xmlrpc/services/UserDeployedServices.py b/server/src/uds/xmlrpc/services/UserDeployedServices.py index 05460782..eb5bf268 100644 --- a/server/src/uds/xmlrpc/services/UserDeployedServices.py +++ b/server/src/uds/xmlrpc/services/UserDeployedServices.py @@ -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)