Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vCloud module utils error handling bug fixes #15859

Merged
merged 2 commits into from
May 14, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/ansible/module_utils/vca.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def get_vm(self, vapp_name, vm_name):

def create_instance(self):
service_type = self.params.get('service_type', DEFAULT_SERVICE_TYPE)
if service_type == 'vcd':
if service_type == 'vcd':
host = self.params['host']
else:
host = LOGIN_HOST[service_type]
Expand All @@ -136,7 +136,7 @@ def login(self):
login_org = self.params['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:
method_name = 'login_%s' % service_type
Expand All @@ -145,7 +145,7 @@ def login(self):
except AttributeError:
self.fail('no login method exists for service_type %s' % service_type)
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):
instance_id = self.params['instance_id']
Expand All @@ -160,14 +160,14 @@ def login_vchs(self):

org = self.params['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)

def login_vcd(self):
org = self.params['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:
raise VcaError('unable to get token for service_type vcd')
Expand Down