fixed pool logic and other fixes

master
ifiguero 2020-07-23 23:46:24 -04:00
parent bf23fe9b8c
commit d7e0b8c254
2 changed files with 2 additions and 2 deletions

View File

@ -243,7 +243,7 @@ except Exception as e:
try:
(stdout, stderr) = exec_ssh_command("Check for the Resource Pool", "vim-cmd hostsvc/rsrc/pool_config_get {}".format(POOL), ssh, isVerbose)
if stderr.readlines():
if not stdout.readlines():
print("ERROR: Resource Pool '{}' not found.".format(POOL))
sys.exit(1)
except Exception as e:

View File

@ -119,7 +119,7 @@ def exec_ssh_command(message, command, ssh, verbose):
def get_esxi_version(ssh, verbose):
try:
(stdin, stdout, stderr) = exec_ssh_command("Get ESXi version", "esxcli system version get |grep Version",
(stdout, stderr) = exec_ssh_command("Get ESXi version", "esxcli system version get |grep Version",
ssh, verbose)
if re.match("Version", str(stdout.readlines())) is not None:
print("Unable to determine if this is a ESXi Host")