mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
vCloud module utils error handling bug fixes (#15859)
* Fix AttributeError that hides login errors * Typo fixes for vca error messages
This commit is contained in:
committed by
Toshio Kuratomi
parent
85477fa215
commit
4bb4c7e68e
@@ -136,7 +136,7 @@ class VcaAnsibleModule(AnsibleModule):
|
|||||||
login_org = self.params['org']
|
login_org = self.params['org']
|
||||||
|
|
||||||
if not self.vca.login(password=password, org=login_org):
|
if not self.vca.login(password=password, org=login_org):
|
||||||
self.fail('Login to VCA failed', response=self.vca.response.content)
|
self.fail('Login to VCA failed', response=self.vca.response)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
method_name = 'login_%s' % service_type
|
method_name = 'login_%s' % service_type
|
||||||
@@ -145,7 +145,7 @@ class VcaAnsibleModule(AnsibleModule):
|
|||||||
except AttributeError:
|
except AttributeError:
|
||||||
self.fail('no login method exists for service_type %s' % service_type)
|
self.fail('no login method exists for service_type %s' % service_type)
|
||||||
except VcaError, e:
|
except VcaError, e:
|
||||||
self.fail(e.message, response=self.vca.response.content, **e.kwargs)
|
self.fail(e.message, response=self.vca.response, **e.kwargs)
|
||||||
|
|
||||||
def login_vca(self):
|
def login_vca(self):
|
||||||
instance_id = self.params['instance_id']
|
instance_id = self.params['instance_id']
|
||||||
@@ -160,14 +160,14 @@ class VcaAnsibleModule(AnsibleModule):
|
|||||||
|
|
||||||
org = self.params['org']
|
org = self.params['org']
|
||||||
if not org:
|
if not org:
|
||||||
raise VcaError('missing required or for service_type vchs')
|
raise VcaError('missing required org for service_type vchs')
|
||||||
|
|
||||||
self.vca.login_to_org(service_id, org)
|
self.vca.login_to_org(service_id, org)
|
||||||
|
|
||||||
def login_vcd(self):
|
def login_vcd(self):
|
||||||
org = self.params['org']
|
org = self.params['org']
|
||||||
if not org:
|
if not org:
|
||||||
raise VcaError('missing required or for service_type vchs')
|
raise VcaError('missing required org for service_type vcd')
|
||||||
|
|
||||||
if not self.vca.token:
|
if not self.vca.token:
|
||||||
raise VcaError('unable to get token for service_type vcd')
|
raise VcaError('unable to get token for service_type vcd')
|
||||||
|
|||||||
Reference in New Issue
Block a user