diff --git a/manilaclient/osc/v2/share_access_rules.py b/manilaclient/osc/v2/share_access_rules.py index c666821e0..888fe71e3 100644 --- a/manilaclient/osc/v2/share_access_rules.py +++ b/manilaclient/osc/v2/share_access_rules.py @@ -192,19 +192,19 @@ class ListShareAccess(command.Lister): access_list = share.access_list() list_of_keys = [ - 'id', - 'access_type', - 'access_to', - 'access_level', - 'state' + 'ID', + 'Access Type', + 'Access To', + 'Access Level', + 'State' ] if share_client.api_version >= api_versions.APIVersion("2.21"): - list_of_keys.append('access_key') + list_of_keys.append('Access Key') if share_client.api_version >= api_versions.APIVersion("2.33"): - list_of_keys.append('created_at') - list_of_keys.append('updated_at') + list_of_keys.append('Created At') + list_of_keys.append('Updated At') values = (oscutils.get_item_properties( a, list_of_keys) for a in access_list) diff --git a/manilaclient/osc/v2/share_type_access.py b/manilaclient/osc/v2/share_type_access.py index 890f9bd51..b22ae13e3 100644 --- a/manilaclient/osc/v2/share_type_access.py +++ b/manilaclient/osc/v2/share_type_access.py @@ -77,7 +77,7 @@ class ListShareTypeAccess(command.Lister): data = share_client.share_type_access.list(share_type) - columns = ['Project_ID'] + columns = ['Project ID'] values = (oscutils.get_item_properties(s, columns) for s in data) return (columns, values) diff --git a/manilaclient/osc/v2/share_types.py b/manilaclient/osc/v2/share_types.py index 89ec406ff..a878d74da 100644 --- a/manilaclient/osc/v2/share_types.py +++ b/manilaclient/osc/v2/share_types.py @@ -410,7 +410,9 @@ class ListShareType(command.Lister): values = (oscutils.get_dict_properties( s._info, ATTRIBUTES) for s in formatted_types) - return (ATTRIBUTES, values) + columns = utils.format_column_headers(ATTRIBUTES) + + return (columns, values) class ShowShareType(command.ShowOne): diff --git a/manilaclient/tests/unit/osc/v2/test_share_access_rules.py b/manilaclient/tests/unit/osc/v2/test_share_access_rules.py index 9bc7e4edd..fee205f1c 100644 --- a/manilaclient/tests/unit/osc/v2/test_share_access_rules.py +++ b/manilaclient/tests/unit/osc/v2/test_share_access_rules.py @@ -170,14 +170,14 @@ class TestShareAccessDelete(TestShareAccess): class TestShareAccessList(TestShareAccess): access_rules_columns = [ - 'id', - 'access_type', - 'access_to', - 'access_level', - 'state', - 'access_key', - 'created_at', - 'updated_at' + 'ID', + 'Access Type', + 'Access To', + 'Access Level', + 'State', + 'Access Key', + 'Created At', + 'Updated At' ] def setUp(self): diff --git a/manilaclient/tests/unit/osc/v2/test_share_type.py b/manilaclient/tests/unit/osc/v2/test_share_type.py index b943d9d4a..3de8267e4 100644 --- a/manilaclient/tests/unit/osc/v2/test_share_type.py +++ b/manilaclient/tests/unit/osc/v2/test_share_type.py @@ -19,6 +19,7 @@ from osc_lib import utils as oscutils from manilaclient import api_versions from manilaclient.common.apiclient.exceptions import BadRequest from manilaclient.common.apiclient.exceptions import NotFound +from manilaclient.osc import utils from manilaclient.osc.v2 import share_types as osc_share_types from manilaclient.tests.unit.osc import osc_utils from manilaclient.tests.unit.osc.v2 import fakes as manila_fakes @@ -448,6 +449,7 @@ class TestShareTypeUnset(TestShareType): class TestShareTypeList(TestShareType): share_types = manila_fakes.FakeShareType.create_share_types() + columns = utils.format_column_headers(COLUMNS) def setUp(self): super(TestShareTypeList, self).setUp() @@ -473,7 +475,7 @@ class TestShareTypeList(TestShareType): search_opts={}, show_all=False ) - self.assertEqual(COLUMNS, columns) + self.assertEqual(self.columns, columns) self.assertEqual(list(self.values), list(data)) def test_share_type_list_all(self): @@ -490,7 +492,7 @@ class TestShareTypeList(TestShareType): self.shares_mock.list.assert_called_once_with( search_opts={}, show_all=True) - self.assertEqual(COLUMNS, columns) + self.assertEqual(self.columns, columns) self.assertEqual(list(self.values), list(data)) def test_share_type_list_extra_specs(self): @@ -507,7 +509,7 @@ class TestShareTypeList(TestShareType): self.shares_mock.list.assert_called_once_with( search_opts={'extra_specs': {'snapshot_support': 'True'}}, show_all=False) - self.assertEqual(COLUMNS, columns) + self.assertEqual(self.columns, columns) self.assertEqual(list(self.values), list(data)) def test_share_type_list_api_versions_exception(self): diff --git a/manilaclient/tests/unit/osc/v2/test_share_type_access.py b/manilaclient/tests/unit/osc/v2/test_share_type_access.py index 54846a844..00a7a2bab 100644 --- a/manilaclient/tests/unit/osc/v2/test_share_type_access.py +++ b/manilaclient/tests/unit/osc/v2/test_share_type_access.py @@ -91,7 +91,7 @@ class TestShareTypeAccessAllow(TestShareTypeAccess): class TestShareTypeAccessList(TestShareTypeAccess): - columns = ['Project_ID'] + columns = ['Project ID'] data = (('',), ('',)) def setUp(self):