1
0
Fork 0

remove debug thingy, put vagrant indexerror protec

This commit is contained in:
Lili (Tlapka) 2021-04-08 19:33:46 +02:00
parent 8be6527bf7
commit 16146babe6
1 changed files with 12 additions and 10 deletions

View File

@ -48,15 +48,19 @@ def check_prerequisites():
except FileNotFoundError: except FileNotFoundError:
found = False found = False
print("NOK, Vagrant not found.") print("NOK, Vagrant not found.")
if found: try:
version_number = version.stdout.split(" ", 1)[1].split(".") if found:
if version_number[0] == "2": version_number = version.stdout.split(" ", 1)[1].split(".")
if int(version_number[1]) > 1: if version_number[0] == "2":
print("OK, Vagrant version higher than 2.2.") if int(version_number[1]) > 1:
print("OK, Vagrant version higher than 2.2.")
else:
print("NOK, Vagrant version lower than 2.2.")
else: else:
print("NOK, Vagrant version lower than 2.2.") print("NOK, Vagrant 2 not detected.")
else: except IndexError:
print("NOK, Vagrant 2 not detected.") print("Vagrant was found, but the version string couldn't be parsed.")
print("The string in question: {}".format(version.stdout))
found = False found = False
print("checking Virtualbox version:") print("checking Virtualbox version:")
@ -64,10 +68,8 @@ def check_prerequisites():
version = subprocess.run(["VBoxManage", "--version"], capture_output=True, text=True) version = subprocess.run(["VBoxManage", "--version"], capture_output=True, text=True)
found = True found = True
except FileNotFoundError: except FileNotFoundError:
print("capitalzied vbox not found")
pass # try no caps pass # try no caps
if not found: if not found:
print("trying no caps")
try: try:
version = subprocess.run(["vboxmanage", "--version"], capture_output=True, text=True) version = subprocess.run(["vboxmanage", "--version"], capture_output=True, text=True)
found = True found = True