Skip to content

Commit

Permalink
CA-338619: log the hostname when asking slaves
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Syms <mark.syms@citrix.com>
  • Loading branch information
MarkSymsCtx committed Apr 30, 2020
1 parent d2378b0 commit e211352
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions drivers/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ def ensureInactive(self, hostRef, args):
hostRef, self.PLUGIN_ON_SLAVE, "multi", args)
Util.log("call-plugin returned: '%s'" % text)

def getRecordHost(self, hostRef):
return self.session.xenapi.host.get_record(hostRef)

def _getRefVDI(self, uuid):
return self.session.xenapi.VDI.get_by_uuid(uuid)

Expand Down Expand Up @@ -2657,7 +2660,8 @@ def _checkSlaves(self, vdi):
continue
if abortFlag.test(FLAG_TYPE_ABORT):
raise AbortException("Aborting due to signal")
Util.log("Checking with slave %s (path %s)" % (hostRef, vdi.path))
Util.log("Checking with slave %s (path %s)" % (
self.xapi.getRecordHost(hostRef)['hostname'], vdi.path))
try:
self.xapi.ensureInactive(hostRef, args)
except XenAPI.Failure:
Expand All @@ -2684,7 +2688,8 @@ def _updateSlavesOnUndoLeafCoalesce(self, parent, child):
"lvName4": parent.fileName}
for slave in slaves:
Util.log("Updating %s, %s, %s on slave %s" % \
(tmpName, child.fileName, parent.fileName, slave))
(tmpName, child.fileName, parent.fileName,
self.xapi.getRecordHost(slave)['hostname']))
text = self.xapi.session.xenapi.host.call_plugin( \
slave, self.xapi.PLUGIN_ON_SLAVE, "multi", args)
Util.log("call-plugin returned: '%s'" % text)
Expand All @@ -2705,7 +2710,8 @@ def _updateSlavesOnRename(self, vdi, oldNameLV, origParentUuid):
"ns3" : lvhdutil.NS_PREFIX_LVM + self.uuid}
for slave in slaves:
Util.log("Updating %s to %s on slave %s" % \
(oldNameLV, vdi.fileName, slave))
(oldNameLV, vdi.fileName,
self.xapi.getRecordHost(slave)['hostname']))
text = self.xapi.session.xenapi.host.call_plugin( \
slave, self.xapi.PLUGIN_ON_SLAVE, "multi", args)
Util.log("call-plugin returned: '%s'" % text)
Expand Down

0 comments on commit e211352

Please sign in to comment.