mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-10 02:09:11 -07:00
Port the module snippet to python3 (#15870)
vca depend on pyvcloud, who depend on PyYAML 3.10, which support python 2.5 as a minimum, cf https://github.com/vmware/pyvcloud/blob/master/requirements.txt and http://pyyaml.org/wiki/PyYAML vmware.py depend on PyVIM, who depend on python 2.6. So we can use the modern syntax for both of them.
This commit is contained in:
parent
e539b2003d
commit
127a37f67c
2 changed files with 4 additions and 4 deletions
|
@ -144,7 +144,7 @@ class VcaAnsibleModule(AnsibleModule):
|
|||
meth()
|
||||
except AttributeError:
|
||||
self.fail('no login method exists for service_type %s' % service_type)
|
||||
except VcaError, e:
|
||||
except VcaError as e:
|
||||
self.fail(e.message, response=self.vca.response, **e.kwargs)
|
||||
|
||||
def login_vca(self):
|
||||
|
@ -318,7 +318,7 @@ def vca_login(module):
|
|||
_vchs_login(vca, password, service, org)
|
||||
elif service_type == 'vcd':
|
||||
_vcd_login(vca, password, org)
|
||||
except VcaError, e:
|
||||
except VcaError as e:
|
||||
module.fail_json(msg=e.message, **e.kwargs)
|
||||
|
||||
return vca
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue