From: Tony Mack Date: Wed, 5 Dec 2012 18:08:02 +0000 (-0500) Subject: PerformOperationalAction can only be called on fully allocated slivers X-Git-Tag: sfa-3.0-0~63 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=b013e7c8642f9fb267080cf1d233e61f00070046;p=sfa.git PerformOperationalAction can only be called on fully allocated slivers --- diff --git a/sfa/openstack/nova_driver.py b/sfa/openstack/nova_driver.py index 08c48db6..b6595b2e 100644 --- a/sfa/openstack/nova_driver.py +++ b/sfa/openstack/nova_driver.py @@ -408,6 +408,16 @@ class NovaDriver(Driver): action_method = aggreate.restart_instances else: raise UnsupportedOperation(action) + + # fault if sliver is not full allocated (operational status is geni_pending_allocation) + description = self.describe(urns, None, options) + for sliver in description['geni_slivers']: + if sliver['geni_operational_status'] == 'geni_pending_allocation': + raise UnsupportedOperation(action, "Sliver must be fully allocated (operational status is not geni_pending_allocation)") + # + # Perform Operational Action Here + # + instances = aggregate.get_instances(urns) for instance in instances: tenant_name = self.driver.shell.auth_manager.client.tenant_name