diff --git a/lib/ansible/modules/extras/cloud/vmware/vca_fw.py b/lib/ansible/modules/extras/cloud/vmware/vca_fw.py index 90500a977c..019cd2adb0 100644 --- a/lib/ansible/modules/extras/cloud/vmware/vca_fw.py +++ b/lib/ansible/modules/extras/cloud/vmware/vca_fw.py @@ -181,7 +181,7 @@ def main(): try: desired_rules = validate_fw_rules(fw_rules) - except VcaError, e: + except VcaError as e: module.fail_json(msg=e.message) result = dict(changed=False) diff --git a/lib/ansible/modules/extras/cloud/vmware/vca_nat.py b/lib/ansible/modules/extras/cloud/vmware/vca_nat.py index b7516d5448..7dfa0cd3a6 100644 --- a/lib/ansible/modules/extras/cloud/vmware/vca_nat.py +++ b/lib/ansible/modules/extras/cloud/vmware/vca_nat.py @@ -154,7 +154,7 @@ def main(): try: desired_rules = validate_nat_rules(nat_rules) - except VcaError, e: + except VcaError as e: module.fail_json(msg=e.message) rules = gateway.get_nat_rules()