Use exception as syntax in inventory, as it doesn't require py24 (#15554)

pull/15404/merge
Matt Martz 9 years ago committed by Brian Coca
parent 0eead1a3f6
commit 5549292d69

@ -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):

Loading…
Cancel
Save