summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPraharshitha Metla <harshavardhan.metla@tcs.com>2020-07-30 16:30:06 +0530
committermelanie witt <melwittt@gmail.com>2020-09-03 00:28:20 +0000
commitd5ff9f87c8af335e1f83476319a2540fead5224c (patch)
tree0c8e4e8d86791474f81d34d16e6715ed63a6dcf8
parent042dc4f2706cf845996ee0bb359be3345fa54863 (diff)
downloadnova-d5ff9f87c8af335e1f83476319a2540fead5224c.tar.gz
Removed the host FQDN from the exception message
Deletion of an instance after disabling the hypervisor by a non-admin user leaks the host fqdn in fault msg of instance.Removing the 'host' field from the error message of HypervisorUnavaiable cause it's leaking host fqdn to non-admin users. The admin user will see the Hypervisor unavailable exception msg but will be able to figure on which compute host the guest is on and that the connection is broken. Change-Id: I0eae19399670f59c17c9a1a24e1bfcbf1b514e7b Closes-Bug: #1851587 (cherry picked from commit a89ffab83261060bbb9dedb2b8de6297b2d07efd) (cherry picked from commit ff82601204e9d724b3032dc94c49fa5c8de2699b) (cherry picked from commit c5abbd17b5552209e53ad61713c4787f47f463c6)
-rw-r--r--nova/exception.py2
-rw-r--r--nova/virt/libvirt/host.py2
-rw-r--r--nova/virt/libvirt/volume/mount.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/nova/exception.py b/nova/exception.py
index b4a300ff25..11d26f55fa 100644
--- a/nova/exception.py
+++ b/nova/exception.py
@@ -521,7 +521,7 @@ class ComputeResourcesUnavailable(ServiceUnavailable):
class HypervisorUnavailable(NovaException):
- msg_fmt = _("Connection to the hypervisor is broken on host: %(host)s")
+ msg_fmt = _("Connection to the hypervisor is broken on host")
class ComputeServiceUnavailable(ServiceUnavailable):
diff --git a/nova/virt/libvirt/host.py b/nova/virt/libvirt/host.py
index de6a68e83f..61b412c91f 100644
--- a/nova/virt/libvirt/host.py
+++ b/nova/virt/libvirt/host.py
@@ -479,7 +479,7 @@ class Host(object):
payload)
compute_utils.notify_about_libvirt_connect_error(
ctxt, ip=CONF.my_ip, exception=ex, tb=traceback.format_exc())
- raise exception.HypervisorUnavailable(host=CONF.host)
+ raise exception.HypervisorUnavailable()
return conn
diff --git a/nova/virt/libvirt/volume/mount.py b/nova/virt/libvirt/volume/mount.py
index a02fe460a3..cd323ee924 100644
--- a/nova/virt/libvirt/volume/mount.py
+++ b/nova/virt/libvirt/volume/mount.py
@@ -86,7 +86,7 @@ class _HostMountStateManager(object):
with self.cond:
state = self.state
if state is None:
- raise exception.HypervisorUnavailable(host=CONF.host)
+ raise exception.HypervisorUnavailable()
self.use_count += 1
try: