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
This commit is contained in:
parent
4bafc32616
commit
1517f4af21
|
@ -42,6 +42,7 @@ def _format_namespace(namespace):
|
|||
'owner',
|
||||
'protected',
|
||||
'schema',
|
||||
'updated_at',
|
||||
'visibility',
|
||||
]
|
||||
|
||||
|
@ -130,8 +131,9 @@ class CreateMetadefNameSpace(command.ShowOne):
|
|||
kwargs['visibility'] = parsed_args.visibility
|
||||
|
||||
data = image_client.create_metadef_namespace(**kwargs)
|
||||
info = _format_namespace(data)
|
||||
|
||||
return zip(*sorted(data.items()))
|
||||
return zip(*sorted(info.items()))
|
||||
|
||||
|
||||
class DeleteMetadefNameSpace(command.Command):
|
||||
|
|
|
@ -21,30 +21,16 @@ class TestMetadefNamespaceCreate(image_fakes.TestImagev2):
|
|||
|
||||
expected_columns = (
|
||||
'created_at',
|
||||
'description',
|
||||
'display_name',
|
||||
'id',
|
||||
'is_protected',
|
||||
'location',
|
||||
'name',
|
||||
'namespace',
|
||||
'owner',
|
||||
'resource_type_associations',
|
||||
'updated_at',
|
||||
'visibility',
|
||||
)
|
||||
expected_data = (
|
||||
_metadef_namespace.created_at,
|
||||
_metadef_namespace.description,
|
||||
_metadef_namespace.display_name,
|
||||
_metadef_namespace.id,
|
||||
_metadef_namespace.is_protected,
|
||||
_metadef_namespace.location,
|
||||
_metadef_namespace.name,
|
||||
_metadef_namespace.namespace,
|
||||
_metadef_namespace.owner,
|
||||
_metadef_namespace.resource_type_associations,
|
||||
_metadef_namespace.updated_at,
|
||||
_metadef_namespace.visibility,
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue