diff options
| author | Richard Theis <rtheis@us.ibm.com> | 2016-02-26 11:33:45 -0600 |
|---|---|---|
| committer | Richard Theis <rtheis@us.ibm.com> | 2016-03-10 08:33:52 -0600 |
| commit | 564c8ff2403da87b96562076865f42426a4f8eac (patch) | |
| tree | 6ff87996ca4a35647361d14866dc685dd5fef526 /openstackclient/tests/compute | |
| parent | f8ac17ac52fa42067c881254e243ebe4514624be (diff) | |
| download | python-openstackclient-564c8ff2403da87b96562076865f42426a4f8eac.tar.gz | |
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
Diffstat (limited to 'openstackclient/tests/compute')
| -rw-r--r-- | openstackclient/tests/compute/v2/fakes.py | 13 |
1 files changed, 10 insertions, 3 deletions
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: |
