From daae4d922a771c2718ee1f067d665a2878488da7 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Wed, 3 Jan 2018 15:14:53 +0530 Subject: [PATCH] Add missing msg keyword for fail_json (#34387) Signed-off-by: Abhijeet Kasurde --- lib/ansible/modules/cloud/amazon/lightsail.py | 3 ++- lib/ansible/modules/packaging/os/package_facts.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/lightsail.py b/lib/ansible/modules/cloud/amazon/lightsail.py index fc12b89b718..0acc0daacec 100644 --- a/lib/ansible/modules/cloud/amazon/lightsail.py +++ b/lib/ansible/modules/cloud/amazon/lightsail.py @@ -413,7 +413,7 @@ def core(module): client = boto3_conn(module, conn_type='client', resource='lightsail', region=region, endpoint=ec2_url, **aws_connect_kwargs) except (botocore.exceptions.ClientError, botocore.exceptions.ValidationError) as e: - module.fail_json('Failed while connecting to the lightsail service: %s' % e, exception=traceback.format_exc()) + module.fail_json(msg='Failed while connecting to the lightsail service: %s' % e, exception=traceback.format_exc()) changed = False state = module.params['state'] @@ -468,5 +468,6 @@ def main(): except (botocore.exceptions.ClientError, Exception) as e: module.fail_json(msg=str(e), exception=traceback.format_exc()) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/packaging/os/package_facts.py b/lib/ansible/modules/packaging/os/package_facts.py index d97c8a0b18e..37e8d5033be 100644 --- a/lib/ansible/modules/packaging/os/package_facts.py +++ b/lib/ansible/modules/packaging/os/package_facts.py @@ -151,7 +151,7 @@ def rpm_package_list(): try: import rpm except ImportError: - module.fail_json('Unable to use the rpm python bindings, please ensure they are installed under the python the module runs under') + module.fail_json(msg='Unable to use the rpm python bindings, please ensure they are installed under the python the module runs under') trans_set = rpm.TransactionSet() installed_packages = {} @@ -174,7 +174,7 @@ def apt_package_list(): try: import apt except ImportError: - module.fail_json('Unable to use the apt python bindings, please ensure they are installed under the python the module runs under') + module.fail_json(msg='Unable to use the apt python bindings, please ensure they are installed under the python the module runs under') apt_cache = apt.Cache() installed_packages = {}