Skip to content

Commit 1517f4a

Browse files
author
Mridula Joshi
committed
Explicitly specify namespace fields for output
Rather than excluding the few fields we don't want, explicitly indicate the ones we do want. Note that this is a problem in the tests for virtually all commands that will be seen as the SDK continues to evolve and new fields are added to existing resources. Change-Id: Ia8d487e1e7804fa177fce46497c0202aed8acb08
1 parent 4bafc32 commit 1517f4a

2 files changed

Lines changed: 3 additions & 15 deletions

File tree

openstackclient/image/v2/metadef_namespaces.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def _format_namespace(namespace):
4242
'owner',
4343
'protected',
4444
'schema',
45+
'updated_at',
4546
'visibility',
4647
]
4748

@@ -130,8 +131,9 @@ def take_action(self, parsed_args):
130131
kwargs['visibility'] = parsed_args.visibility
131132

132133
data = image_client.create_metadef_namespace(**kwargs)
134+
info = _format_namespace(data)
133135

134-
return zip(*sorted(data.items()))
136+
return zip(*sorted(info.items()))
135137

136138

137139
class DeleteMetadefNameSpace(command.Command):

openstackclient/tests/unit/image/v2/test_metadef_namespaces.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,16 @@ class TestMetadefNamespaceCreate(image_fakes.TestImagev2):
2121

2222
expected_columns = (
2323
'created_at',
24-
'description',
2524
'display_name',
26-
'id',
27-
'is_protected',
28-
'location',
29-
'name',
3025
'namespace',
3126
'owner',
32-
'resource_type_associations',
33-
'updated_at',
3427
'visibility',
3528
)
3629
expected_data = (
3730
_metadef_namespace.created_at,
38-
_metadef_namespace.description,
3931
_metadef_namespace.display_name,
40-
_metadef_namespace.id,
41-
_metadef_namespace.is_protected,
42-
_metadef_namespace.location,
43-
_metadef_namespace.name,
4432
_metadef_namespace.namespace,
4533
_metadef_namespace.owner,
46-
_metadef_namespace.resource_type_associations,
47-
_metadef_namespace.updated_at,
4834
_metadef_namespace.visibility,
4935
)
5036

0 commit comments

Comments
 (0)