Merge "Fix for displaying export locations for share snapshot."

This commit is contained in:
Zuul
2022-05-19 14:57:52 +00:00
committed by Gerrit Code Review
2 changed files with 10 additions and 3 deletions

View File

@@ -177,11 +177,17 @@ class ShowShareSnapshot(command.ShowOne):
share_client.share_snapshot_export_locations.list(
share_snapshot))
export_locations = cliutils.convert_dict_list_to_string(
export_locations, ignored_keys=['links'])
locations = []
for location in export_locations:
location._info.pop('links', None)
locations.append(location._info)
if parsed_args.formatter == 'table':
locations = cliutils.convert_dict_list_to_string(
locations)
data = share_snapshot._info
data['export_locations'] = export_locations
data['export_locations'] = locations
data.pop('links', None)
return self.dict2columns(data)

View File

@@ -362,6 +362,7 @@ class TestShareSnapshotShow(TestShareSnapshot):
self.data = self.share_snapshot._info.values()
self.columns = self.share_snapshot._info.keys()
self.export_locations_mock.list.return_value = [self.export_location]
def test_share_snapshot_show_missing_args(self):
arglist = []