diff options
| author | Mark Washenberger <mark.washenberger@rackspace.com> | 2011-10-24 14:28:47 -0400 |
|---|---|---|
| committer | Mark Washenberger <mark.washenberger@rackspace.com> | 2011-10-26 15:11:47 -0400 |
| commit | 18e43e6b4dffba73dd35afb797dfa4e1d6cd00fe (patch) | |
| tree | 86feca1aad14f3c4e20bd630acb5fe9289698816 /nova/compute | |
| parent | fa74f5c59da8e1641d97333d0b8ee6147fb17947 (diff) | |
Support server uuids with security groups
Change-Id: I15dd5a5e26b2d22fa3def75fa950f1155e6911ac
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index 57e0d9edd..1ca466291 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -699,7 +699,11 @@ class API(base.Base): context.project_id, security_group_name) # check if the server exists - inst = self.db.instance_get(context, instance_id) + if utils.is_uuid_like(instance_id): + inst = self.db.instance_get_by_uuid(context, instance_id) + else: + inst = self.db.instance_get(context, instance_id) + instance_id = inst['id'] #check if the security group is associated with the server if self._is_security_group_associated_with_server(security_group, instance_id): @@ -725,7 +729,11 @@ class API(base.Base): context.project_id, security_group_name) # check if the server exists - inst = self.db.instance_get(context, instance_id) + if utils.is_uuid_like(instance_id): + inst = self.db.instance_get_by_uuid(context, instance_id) + else: + inst = self.db.instance_get(context, instance_id) + instance_id = inst['id'] #check if the security group is associated with the server if not self._is_security_group_associated_with_server(security_group, instance_id): |
