vmware / vsphere-automation-sdk-python

Python samples, language bindings, and API reference documentation for vSphere, VMC, and NSX-T using the VMware REST API
MIT License
739 stars 308 forks source link

Fix argument handling #405

Open rsommer opened 7 months ago

rsommer commented 7 months ago

The key part of the argument handling has to be right after args, otherwise you'd get an AttributeError when trying to call encode on the args object.

Traceback (most recent call last):
  File "/tmp/tmp.VR4pSjeDta/vsphere-automation-sdk-python/samples/vsphere/vcenter/certificatemanagement/replace_tls_certificate.py", line 63, in <module>
    key = args.encode(encoding='utf-8').key.decode('unicode_escape')
AttributeError: 'Namespace' object has no attribute 'encode'
vmwclabot commented 7 months ago

@rsommer, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.