I am having trouble with what is presumably a simple if statement. I am trying to pass through the type of VM file format to use. Even if I put VMDK or VHD, it still comes back with VMDK is an invalid type or VHD is an invalid type.
import sys
vmtype = sys.argv[3]
vmtype = str(vmtype).strip().upper()
## File format check
if vmtype is not ("VHD") or ("VMDK"):
print vmtype + " is an invalid type"
sys.exit()
I have tried the if statement with != and not putting the parameters in parentheses. I have searched the web for a while and have tried what I have found and am still running into the same issue.
FYI I am running Python 2.6.5