summaryrefslogtreecommitdiff
path: root/openstackclient/compute/v2
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/compute/v2')
-rw-r--r--openstackclient/compute/v2/server.py19
-rw-r--r--openstackclient/compute/v2/server_event.py6
2 files changed, 20 insertions, 5 deletions
diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py
index 69aaa3c5..436c2597 100644
--- a/openstackclient/compute/v2/server.py
+++ b/openstackclient/compute/v2/server.py
@@ -2537,7 +2537,7 @@ class ListServer(command.Lister):
# and 'image' missing in the server response during
# infrastructure failure situations.
# For those servers with partial constructs we just skip the
- # processing of the image and flavor informations.
+ # processing of the image and flavor information.
if not hasattr(s, 'image') or not hasattr(s, 'flavor'):
continue
@@ -2569,6 +2569,21 @@ class ListServer(command.Lister):
else:
s.security_groups_name = []
+ # The host_status field contains the status of the compute host the
+ # server is on. It is only returned by the API when the nova-api
+ # policy allows. Users can look at the host_status field when, for
+ # example, their server has status ACTIVE but is unresponsive. The
+ # host_status field can indicate a possible problem on the host
+ # it's on, providing useful information to a user in this
+ # situation.
+ if (
+ compute_client.api_version >= api_versions.APIVersion('2.16') and
+ parsed_args.long
+ ):
+ if any([hasattr(s, 'host_status') for s in data]):
+ columns += ('Host Status',)
+ column_headers += ('Host Status',)
+
table = (
column_headers,
(
@@ -4020,7 +4035,7 @@ class ShelveServer(command.Command):
server_obj.shelve()
- # if we don't hav to wait, either because it was requested explicitly
+ # if we don't have to wait, either because it was requested explicitly
# or is required implicitly, then our job is done
if not parsed_args.wait and not parsed_args.offload:
return
diff --git a/openstackclient/compute/v2/server_event.py b/openstackclient/compute/v2/server_event.py
index 7ab0cd2f..ebf0d526 100644
--- a/openstackclient/compute/v2/server_event.py
+++ b/openstackclient/compute/v2/server_event.py
@@ -19,10 +19,10 @@ import logging
import iso8601
from novaclient import api_versions
-import openstack.cloud._utils
from osc_lib.command import command
from osc_lib import exceptions
from osc_lib import utils
+from oslo_utils import uuidutils
from openstackclient.i18n import _
@@ -152,7 +152,7 @@ class ListServerEvent(command.Lister):
# If we fail to find the resource, it is possible the server is
# deleted. Try once more using the <server> arg directly if it is a
# UUID.
- if openstack.cloud._utils._is_uuid_like(parsed_args.server):
+ if uuidutils.is_uuid_like(parsed_args.server):
server_id = parsed_args.server
else:
raise
@@ -224,7 +224,7 @@ class ShowServerEvent(command.ShowOne):
# If we fail to find the resource, it is possible the server is
# deleted. Try once more using the <server> arg directly if it is a
# UUID.
- if openstack.cloud._utils._is_uuid_like(parsed_args.server):
+ if uuidutils.is_uuid_like(parsed_args.server):
server_id = parsed_args.server
else:
raise