From 564c8ff2403da87b96562076865f42426a4f8eac Mon Sep 17 00:00:00 2001 From: Richard Theis Date: Fri, 26 Feb 2016 11:33:45 -0600 Subject: Refactor security group show to use SDK Refactored the 'os security group show' command to use the SDK when neutron is enabled, but continue to use the nova client when nova network is enabled. Added a release note for the change in security group rules output due to Network v2. The column names remain unchanged to maintain backwards compatibility. Change-Id: I25233ddb8115d18b8b88affb3de13346084a339d Partial-Bug: #1519511 Implements: blueprint neutron-client --- openstackclient/tests/compute/v2/fakes.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'openstackclient/tests/compute') diff --git a/openstackclient/tests/compute/v2/fakes.py b/openstackclient/tests/compute/v2/fakes.py index 11d9ff1b..26d3a283 100644 --- a/openstackclient/tests/compute/v2/fakes.py +++ b/openstackclient/tests/compute/v2/fakes.py @@ -333,7 +333,9 @@ class FakeSecurityGroup(object): security_group_attrs.update(attrs) # Set default methods. - security_group_methods = {} + security_group_methods = { + 'keys': ['id', 'name', 'description', 'tenant_id', 'rules'], + } # Overwrite default methods. security_group_methods.update(methods) @@ -369,7 +371,7 @@ class FakeSecurityGroupRule(object): """Fake one or more security group rules.""" @staticmethod - def create_one_security_group_rule(attrs={}, methods={}): + def create_one_security_group_rule(attrs=None, methods=None): """Create a fake security group rule. :param Dictionary attrs: @@ -379,6 +381,11 @@ class FakeSecurityGroupRule(object): :return: A FakeResource object, with id, etc. """ + if attrs is None: + attrs = {} + if methods is None: + methods = {} + # Set default attributes. security_group_rule_attrs = { 'from_port': -1, @@ -406,7 +413,7 @@ class FakeSecurityGroupRule(object): return security_group_rule @staticmethod - def create_security_group_rules(attrs={}, methods={}, count=2): + def create_security_group_rules(attrs=None, methods=None, count=2): """Create multiple fake security group rules. :param Dictionary attrs: -- cgit v1.2.1