Skip to content

Commit

Permalink
libvirt: Fix log message when disable/enable a host
Browse files Browse the repository at this point in the history
When disable/enable a host, the log message is not correct. As
nova compute will log message saying the host was disabled when
enable a host and log message saying the host was enabled when
disable a host.

We should do as this:
update to disable -> log message should be the host was disabled
update to enable -> log message should be the host was enabled

Change-Id: I394e92fe6fe5ffa06464f1ba93e9fc2acec942ef
Closes-Bug: #1251822
  • Loading branch information
Jay Lau committed Nov 22, 2013
1 parent 41eb4ef commit 65ae112
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nova/virt/libvirt/driver.py
Expand Up @@ -2654,8 +2654,8 @@ def set_host_enabled(self, host, enabled):
healthy hosts out of rotation.
"""

status_name = {True: 'Enabled',
False: 'Disabled'}
status_name = {True: 'disabled',
False: 'enabled'}

if isinstance(enabled, bool):
disable_service = not enabled
Expand Down Expand Up @@ -2683,7 +2683,7 @@ def set_host_enabled(self, host, enabled):
DISABLE_PREFIX + disable_reason
if disable_service else '')
service.save()
LOG.debug(_('Updating compute service status to: %s'),
LOG.debug(_('Updating compute service status to %s'),
status_name[disable_service])
else:
LOG.debug(_('Not overriding manual compute service '
Expand Down

0 comments on commit 65ae112

Please sign in to comment.