diff --git a/Util.py b/Util.py index 7bff2d0..5bad141 100644 --- a/Util.py +++ b/Util.py @@ -63,15 +63,15 @@ def executeCommand(command): return result -def executeCommandOn(strTargetMachineName, strCommand): +def executeCommandOn(target_machine_fqdn, strCommand): """ execute command on a local or remote machine (using ssh then) """ - # print("comparing %s and %s" % (Lib.Util.getHostName(), strTargetMachineName)) - if getHostName() == strTargetMachineName: + print("comparing %s and %s" % (getHostName(), target_machine_fqdn.split('.')[0])) + if getHostName() == target_machine_fqdn.split('.')[0]: return executeCommand(strCommand) else: - return executeProgram(['ssh', strTargetMachineName, "%s" % strCommand]) + return executeProgram(['ssh', target_machine_fqdn, "%s" % strCommand]) def getUpsStatus():