summaryrefslogtreecommitdiff
path: root/horizon/api/nova.py
diff options
context:
space:
mode:
authorGabriel Hurley <gabriel@strikeawe.com>2012-06-06 18:52:27 -0700
committerGabriel Hurley <gabriel@strikeawe.com>2012-06-06 18:52:27 -0700
commite1eaaa3290cceb0c261ab57372657193aef9cb52 (patch)
treee89f004fb59fb81998396c4bd3327ca6d3aa57ad /horizon/api/nova.py
parent59e862e4226edadf01b84b6072c3cfecb4241415 (diff)
downloadtuskar-ui-e1eaaa3290cceb0c261ab57372657193aef9cb52.tar.gz
Prevent erroneous log message when accessing security rules.
Fixes bug 1009797. Change-Id: Ic8f627610b235c5d71a210800b3318619715106e
Diffstat (limited to 'horizon/api/nova.py')
-rw-r--r--horizon/api/nova.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/horizon/api/nova.py b/horizon/api/nova.py
index 5c575908..4f124487 100644
--- a/horizon/api/nova.py
+++ b/horizon/api/nova.py
@@ -162,11 +162,11 @@ class SecurityGroup(APIResourceWrapper):
@property
def rules(self):
"""Wraps transmitted rule info in the novaclient rule class."""
- if not hasattr(self, "_rules"):
+ if "_rules" not in self.__dict__:
manager = nova_rules.SecurityGroupRuleManager
self._rules = [nova_rules.SecurityGroupRule(manager, rule) for \
rule in self._apiresource.rules]
- return self._rules
+ return self.__dict__['_rules']
@rules.setter
def rules(self, value):
@@ -330,11 +330,11 @@ def server_security_groups(request, instance_id):
% instance_id)
if body:
# Wrap data in SG objects as novaclient would.
- sg_objects = [NovaSecurityGroup(nclient.security_groups, sg) for
- sg in body.get('security_groups', [])]
+ sg_objs = [NovaSecurityGroup(nclient.security_groups, sg, loaded=True)
+ for sg in body.get('security_groups', [])]
# Then wrap novaclient's object with our own. Yes, sadly wrapping
# with two layers of objects is necessary.
- security_groups = [SecurityGroup(sg) for sg in sg_objects]
+ security_groups = [SecurityGroup(sg) for sg in sg_objs]
# Package up the rules, as well.
for sg in security_groups:
rule_objects = [SecurityGroupRule(rule) for rule in sg.rules]