Skip to content

Commit 142c5fa

Browse files
author
Nir Magnezi
committed
Fix Octavia gate breakage caused by _get_columns()
The above mentioned function tries to extract keys() from an item which is type class. This patch fixes the issue by converting item to dict by using to_dict(). Change-Id: Ida520ae9fe64171d105f486ba06eda127a24547b Closes-Bug: #1654887
1 parent 1957690 commit 142c5fa

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

openstackclient/network/v2/security_group.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def _format_compute_security_group_rules(sg_rules):
7474
def _get_columns(item):
7575
# Build the display columns and a list of the property columns
7676
# that need to be mapped (display column name, property name).
77-
columns = list(item.keys())
77+
columns = list(item.to_dict().keys())
7878
property_column_mappings = []
7979
if 'security_group_rules' in columns:
8080
columns.append('rules')
@@ -156,7 +156,7 @@ def take_action_compute(self, client, parsed_args):
156156
parsed_args.name,
157157
description,
158158
)
159-
display_columns, property_columns = _get_columns(obj._info)
159+
display_columns, property_columns = _get_columns(obj)
160160
data = utils.get_dict_properties(
161161
obj._info,
162162
property_columns,
@@ -336,7 +336,7 @@ def take_action_compute(self, client, parsed_args):
336336
client.security_groups,
337337
parsed_args.group,
338338
)
339-
display_columns, property_columns = _get_columns(obj._info)
339+
display_columns, property_columns = _get_columns(obj)
340340
data = utils.get_dict_properties(
341341
obj._info,
342342
property_columns,

openstackclient/tests/functional/network/v2/test_security_group.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
import uuid
1414

15-
import testtools
16-
1715
from openstackclient.tests.functional import base
1816

1917

@@ -25,7 +23,6 @@ class SecurityGroupTests(base.TestCase):
2523
FIELDS = ['name']
2624

2725
@classmethod
28-
@testtools.skip('broken SDK testing')
2926
def setUpClass(cls):
3027
opts = cls.get_opts(cls.FIELDS)
3128
raw_output = cls.openstack('security group create ' + cls.NAME + opts)

openstackclient/tests/functional/network/v2/test_security_group_rule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class SecurityGroupRuleTests(base.TestCase):
2626
ID_HEADER = ['ID']
2727

2828
@classmethod
29-
@testtools.skip('broken SDK testing')
3029
def setUpClass(cls):
3130
# Create the security group to hold the rule.
3231
opts = cls.get_opts(cls.NAME_FIELD)
@@ -55,6 +54,7 @@ def tearDownClass(cls):
5554
cls.SECURITY_GROUP_NAME)
5655
cls.assertOutput('', raw_output)
5756

57+
@testtools.skip('broken SDK testing')
5858
def test_security_group_rule_list(self):
5959
opts = self.get_opts(self.ID_HEADER)
6060
raw_output = self.openstack('security group rule list ' +

openstackclient/tests/unit/fakes.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ def __repr__(self):
212212
def keys(self):
213213
return self._info.keys()
214214

215+
def to_dict(self):
216+
return self._info
217+
215218
@property
216219
def info(self):
217220
return self._info

0 commit comments

Comments
 (0)