Skip to content

Commit

Permalink
fixing calls to fail_json
Browse files Browse the repository at this point in the history
  • Loading branch information
chrrrles committed Oct 12, 2015
1 parent 50372ee commit 3d533cb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/ansible/module_utils/vca.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,26 +196,26 @@ def exit(self, **kwargs):

def _validate_module(module):
if not HAS_PYVCLOUD:
module.fail_json("python module pyvcloud is needed for this module")
module.fail_json(msg="python module pyvcloud is needed for this module")

service_type = module.params.get('service_type', DEFAULT_SERVICE_TYPE)

if service_type == 'vca':
for arg in VCA_REQ_ARGS:
if module.params.get(arg) is None:
module.fail_json("argument %s is mandatory when service type "
module.fail_json(msg="argument %s is mandatory when service type "
"is vca" % arg)

if service_type == 'vchs':
for arg in VCHS_REQ_ARGS:
if module.params.get(arg) is None:
module.fail_json("argument %s is mandatory when service type "
module.fail_json(msg="argument %s is mandatory when service type "
"is vchs" % arg)

if service_type == 'vcd':
for arg in VCD_REQ_ARGS:
if module.params.get(arg) is None:
module.fail_json("argument %s is mandatory when service type "
module.fail_json(msg="argument %s is mandatory when service type "
"is vcd" % arg)


Expand Down

0 comments on commit 3d533cb

Please sign in to comment.