mirror of https://github.com/Kodomo/esxi-vm
fixed pool logic and other fixes
parent
bf23fe9b8c
commit
d7e0b8c254
|
@ -243,7 +243,7 @@ except Exception as e:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
(stdout, stderr) = exec_ssh_command("Check for the Resource Pool", "vim-cmd hostsvc/rsrc/pool_config_get {}".format(POOL), ssh, isVerbose)
|
(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))
|
print("ERROR: Resource Pool '{}' not found.".format(POOL))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
@ -119,7 +119,7 @@ def exec_ssh_command(message, command, ssh, verbose):
|
||||||
|
|
||||||
def get_esxi_version(ssh, verbose):
|
def get_esxi_version(ssh, verbose):
|
||||||
try:
|
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)
|
ssh, verbose)
|
||||||
if re.match("Version", str(stdout.readlines())) is not None:
|
if re.match("Version", str(stdout.readlines())) is not None:
|
||||||
print("Unable to determine if this is a ESXi Host")
|
print("Unable to determine if this is a ESXi Host")
|
||||||
|
|
Loading…
Reference in New Issue