vmware / pyvmomi-community-samples

A place for community contributed samples for the pyVmomi library.
Apache License 2.0
1.01k stars 922 forks source link

args.vm_pwd argument causing the issue #resolved #709

Closed mismailzz closed 1 year ago

mismailzz commented 2 years ago

On execution of the script, It was showing that the args.vm_pwd does not exist.

Detail of the error:

Traceback (most recent call last):
  File "execute_program_in_vm.py", line 113, in <module>
    main()
  File "execute_program_in_vm.py", line 64, in main
    username=args.vm_user, password=args.vm_pwd
AttributeError: 'Namespace' object has no attribute 'vm_pwd'

I resolved it by analyzing the arguments in the Namespace object

coolboole commented 1 year ago

Please can this be merged into master VMware.

DanielDraganov commented 1 year ago

The full name of the argument is "--vm-password"

From https://docs.python.org/dev/library/argparse.html#dest: "Any internal - characters will be converted to _ characters to make sure the string is a valid attribute name."

Thank you for fixing that.