diff --git a/src/main/python/clc_ansible_module/clc_publicip.py b/src/main/python/clc_ansible_module/clc_publicip.py index dd46ef9..bd96107 100644 --- a/src/main/python/clc_ansible_module/clc_publicip.py +++ b/src/main/python/clc_ansible_module/clc_publicip.py @@ -272,7 +272,7 @@ def _add_publicip_to_server(self, server, ports_to_expose, source_restrictions=N result = None try: result = server.PublicIPs().Add(ports=ports_to_expose, source_restrictions=source_restrictions) - except CLCException, ex: + except CLCException as ex: self.module.fail_json(msg='Failed to add public ip to the server : {0}. {1}'.format( server.id, ex.response_text )) @@ -309,7 +309,7 @@ def _remove_publicip_from_server(self, server): try: for ip_address in server.PublicIPs().public_ips: result = ip_address.Delete() - except CLCException, ex: + except CLCException as ex: self.module.fail_json(msg='Failed to remove public ip from the server : {0}. {1}'.format( server.id, ex.response_text ))