identity: Use previous naming for 'service show' fields

We changed these in change I37d07a6c5cdc98680b8d65d596521cad2b049500 but
the '-c/--column' option provided by cliff currently requires an
explicit match on column names. Change them back for now. We can revert
this when cliff is a little bit smarter.

Change-Id: I9180922e9da5c22ae3d8878946d1bf1ec4b8c6e1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2076212
This commit is contained in:
Stephen Finucane 2024-08-07 12:06:33 +01:00
parent a59262e44d
commit 25780e80ab
6 changed files with 19 additions and 19 deletions

View File

@ -37,11 +37,11 @@ def _format_service(service):
'description', 'description',
) )
column_headers = ( column_headers = (
'ID', 'id',
'Name', 'name',
'Type', 'type',
'Enabled', 'enabled',
'Description', 'description',
) )
return ( return (

View File

@ -48,7 +48,7 @@ class IdentityTests(base.TestCase):
'parent_id', 'parent_id',
] ]
ROLE_FIELDS = ['id', 'name', 'domain_id', 'description'] ROLE_FIELDS = ['id', 'name', 'domain_id', 'description']
SERVICE_FIELDS = ['ID', 'Enabled', 'Name', 'Type', 'Description'] SERVICE_FIELDS = ['id', 'enabled', 'name', 'type', 'description']
REGION_FIELDS = ['description', 'enabled', 'parent_region', 'region'] REGION_FIELDS = ['description', 'enabled', 'parent_region', 'region']
ENDPOINT_FIELDS = [ ENDPOINT_FIELDS = [
'id', 'id',
@ -376,7 +376,7 @@ class IdentityTests(base.TestCase):
if add_clean_up: if add_clean_up:
service = self.parse_show_as_object(raw_output) service = self.parse_show_as_object(raw_output)
self.addCleanup( self.addCleanup(
self.openstack, 'service delete %s' % service['ID'] self.openstack, 'service delete %s' % service['id']
) )
items = self.parse_show(raw_output) items = self.parse_show(raw_output)
self.assert_show_fields(items, self.SERVICE_FIELDS) self.assert_show_fields(items, self.SERVICE_FIELDS)

View File

@ -32,7 +32,7 @@ class LimitTestCase(common.IdentityTests):
raw_output = self.openstack('service show %s' % service_id) raw_output = self.openstack('service show %s' % service_id)
items = self.parse_show(raw_output) items = self.parse_show(raw_output)
service_name = self._extract_value_from_items('Name', items) service_name = self._extract_value_from_items('name', items)
project_name = self._create_dummy_project() project_name = self._create_dummy_project()
raw_output = self.openstack('project show %s' % project_name) raw_output = self.openstack('project show %s' % project_name)
@ -73,7 +73,7 @@ class LimitTestCase(common.IdentityTests):
raw_output = self.openstack('service show %s' % service_id) raw_output = self.openstack('service show %s' % service_id)
items = self.parse_show(raw_output) items = self.parse_show(raw_output)
service_name = self._extract_value_from_items('Name', items) service_name = self._extract_value_from_items('name', items)
project_name = self._create_dummy_project() project_name = self._create_dummy_project()

View File

@ -29,7 +29,7 @@ class RegisteredLimitTestCase(common.IdentityTests):
'service show' ' %(service_name)s' % {'service_name': service_name} 'service show' ' %(service_name)s' % {'service_name': service_name}
) )
service_items = self.parse_show(raw_output) service_items = self.parse_show(raw_output)
service_id = self._extract_value_from_items('ID', service_items) service_id = self._extract_value_from_items('id', service_items)
raw_output = self.openstack( raw_output = self.openstack(
'registered limit create' 'registered limit create'

View File

@ -61,9 +61,9 @@ class ServiceTests(common.IdentityTests):
raw_output = self.openstack('service show %s' % new_service_name) raw_output = self.openstack('service show %s' % new_service_name)
# assert service details # assert service details
service = self.parse_show_as_object(raw_output) service = self.parse_show_as_object(raw_output)
self.assertEqual(new_service_type, service['Type']) self.assertEqual(new_service_type, service['type'])
self.assertEqual(new_service_name, service['Name']) self.assertEqual(new_service_name, service['name'])
self.assertEqual(new_service_description, service['Description']) self.assertEqual(new_service_description, service['description'])
def test_service_show(self): def test_service_show(self):
service_name = self._create_dummy_service() service_name = self._create_dummy_service()

View File

@ -24,11 +24,11 @@ from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes
class TestServiceCreate(identity_fakes.TestIdentityv3): class TestServiceCreate(identity_fakes.TestIdentityv3):
columns = ( columns = (
'ID', 'id',
'Name', 'name',
'Type', 'type',
'Enabled', 'enabled',
'Description', 'description',
) )
def setUp(self): def setUp(self):
@ -455,7 +455,7 @@ class TestServiceShow(identity_fakes.TestIdentityv3):
self.service.name, ignore_missing=False self.service.name, ignore_missing=False
) )
collist = ('ID', 'Name', 'Type', 'Enabled', 'Description') collist = ('id', 'name', 'type', 'enabled', 'description')
self.assertEqual(collist, columns) self.assertEqual(collist, columns)
datalist = ( datalist = (
self.service.id, self.service.id,