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',
)
column_headers = (
'ID',
'Name',
'Type',
'Enabled',
'Description',
'id',
'name',
'type',
'enabled',
'description',
)
return (

View File

@ -48,7 +48,7 @@ class IdentityTests(base.TestCase):
'parent_id',
]
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']
ENDPOINT_FIELDS = [
'id',
@ -376,7 +376,7 @@ class IdentityTests(base.TestCase):
if add_clean_up:
service = self.parse_show_as_object(raw_output)
self.addCleanup(
self.openstack, 'service delete %s' % service['ID']
self.openstack, 'service delete %s' % service['id']
)
items = self.parse_show(raw_output)
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)
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()
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)
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()

View File

@ -29,7 +29,7 @@ class RegisteredLimitTestCase(common.IdentityTests):
'service show' ' %(service_name)s' % {'service_name': service_name}
)
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(
'registered limit create'

View File

@ -61,9 +61,9 @@ class ServiceTests(common.IdentityTests):
raw_output = self.openstack('service show %s' % new_service_name)
# assert service details
service = self.parse_show_as_object(raw_output)
self.assertEqual(new_service_type, service['Type'])
self.assertEqual(new_service_name, service['Name'])
self.assertEqual(new_service_description, service['Description'])
self.assertEqual(new_service_type, service['type'])
self.assertEqual(new_service_name, service['name'])
self.assertEqual(new_service_description, service['description'])
def test_service_show(self):
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):
columns = (
'ID',
'Name',
'Type',
'Enabled',
'Description',
'id',
'name',
'type',
'enabled',
'description',
)
def setUp(self):
@ -455,7 +455,7 @@ class TestServiceShow(identity_fakes.TestIdentityv3):
self.service.name, ignore_missing=False
)
collist = ('ID', 'Name', 'Type', 'Enabled', 'Description')
collist = ('id', 'name', 'type', 'enabled', 'description')
self.assertEqual(collist, columns)
datalist = (
self.service.id,