From 5549292d69dcdddb95e8371acd0ac735c9490c16 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Fri, 22 Apr 2016 15:34:35 -0500 Subject: [PATCH] Use exception as syntax in inventory, as it doesn't require py24 (#15554) --- contrib/inventory/docker.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/inventory/docker.py b/contrib/inventory/docker.py index 03207a7b732..f138d9dbbc6 100755 --- a/contrib/inventory/docker.py +++ b/contrib/inventory/docker.py @@ -374,7 +374,7 @@ try: from docker.errors import APIError, TLSParameterError from docker.tls import TLSConfig from docker.constants import DEFAULT_TIMEOUT_SECONDS, DEFAULT_DOCKER_API_VERSION -except ImportError, exc: +except ImportError as exc: HAS_DOCKER_ERROR = str(exc) HAS_DOCKER_PY = False @@ -423,9 +423,9 @@ class AnsibleDockerClient(Client): try: super(AnsibleDockerClient, self).__init__(**self._connect_params) - except APIError, exc: + except APIError as exc: self.fail("Docker API error: %s" % exc) - except Exception, exc: + except Exception as exc: self.fail("Error connecting: %s" % exc) def fail(self, msg): @@ -442,7 +442,7 @@ class AnsibleDockerClient(Client): try: tls_config = TLSConfig(**kwargs) return tls_config - except TLSParameterError, exc: + except TLSParameterError as exc: self.fail("TLS config error: %s" % exc) def _get_connect_params(self):