Skip to content

Commit

Permalink
Removed the host FQDN from the exception message
Browse files Browse the repository at this point in the history
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 a89ffab)
(cherry picked from commit ff82601)
(cherry picked from commit c5abbd1)
(cherry picked from commit d5ff9f8)
(cherry picked from commit 8c4af53)
  • Loading branch information
harsha24m authored and melwitt committed Sep 3, 2020
1 parent 8f7dc3d commit 4efdf63
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nova/exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,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):
Expand Down
2 changes: 1 addition & 1 deletion nova/virt/libvirt/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ def get_connection(self):
rpc.get_notifier('compute').error(nova_context.get_admin_context(),
'compute.libvirt.error',
payload)
raise exception.HypervisorUnavailable(host=CONF.host)
raise exception.HypervisorUnavailable()

return conn

Expand Down
2 changes: 1 addition & 1 deletion nova/virt/libvirt/volume/mount.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def get_state(self):
with self.cond:
state = self.state
if state is None:
raise exception.HypervisorUnavailable(host=CONF.host)
raise exception.HypervisorUnavailable()
self.use_count += 1

try:
Expand Down

0 comments on commit 4efdf63

Please sign in to comment.