diff --git a/novaclient/tests/functional/v2/test_os_services.py b/novaclient/tests/functional/v2/test_os_services.py index 3da8449c0..e12e40ae7 100644 --- a/novaclient/tests/functional/v2/test_os_services.py +++ b/novaclient/tests/functional/v2/test_os_services.py @@ -28,8 +28,14 @@ class TestOsServicesNovaClientV211(test_os_services.TestOsServicesNovaClient): # to find them. So filter out anything that's not nova-compute. if serv.binary != 'nova-compute': continue - host = self._get_column_value_from_single_row_table( - self.nova('service-list --binary %s' % serv.binary), 'Host') + service_list = self.nova('service-list --binary %s' % serv.binary) + # Check the 'service-list' table has the 'Forced down' column + status = self._get_column_value_from_single_row_table( + service_list, 'Forced down') + self.assertEqual('False', status) + + host = self._get_column_value_from_single_row_table(service_list, + 'Host') service = self.nova('service-force-down %s %s' % (host, serv.binary)) self.addCleanup(self.nova, 'service-force-down --unset', diff --git a/novaclient/v2/shell.py b/novaclient/v2/shell.py index 947fc31a3..fa74e0b31 100644 --- a/novaclient/v2/shell.py +++ b/novaclient/v2/shell.py @@ -3471,6 +3471,9 @@ def do_service_list(cs, args): result = cs.services.list(host=args.host, binary=args.binary) columns = ["Id", "Binary", "Host", "Zone", "Status", "State", "Updated_at", "Disabled Reason"] + if cs.api_version >= api_versions.APIVersion('2.11'): + columns.append("Forced down") + utils.print_list(result, columns)