25721734 docker-support shutdown-containers traceback in do_api_get
authorEdward Pilatowicz <edward.pilatowicz@oracle.com>
Tue, 14 Mar 2017 16:42:34 -0700
changeset 7794 4953ab4958ad
parent 7793 d390406a8e3f
child 7795 92fb0e1622f7
25721734 docker-support shutdown-containers traceback in do_api_get
components/docker/files/docker-support
--- a/components/docker/files/docker-support	Fri Mar 10 15:41:57 2017 -0800
+++ b/components/docker/files/docker-support	Tue Mar 14 16:42:34 2017 -0700
@@ -1,6 +1,6 @@
 #!/usr/bin/python2.7
 #
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
 #
 
 import argparse
@@ -39,7 +39,7 @@
         con = HTTPConnectionSocket(DOCKER_SOCK)
         con.request("GET", url)
         resp = con.getresponse()
-    except httplib.HTTPException as err:
+    except (socket.error, httplib.HTTPException) as err:
         raise RuntimeError("unable to call API: %s" % err)
 
     # expect standard success status
@@ -169,7 +169,7 @@
         return [container['Id'] for container in
             do_api_get("http:/containers/json")]
     except RuntimeError as e:
-        print "unable to query api for container list: %s" % e
+        raise SystemExit("unable to query api for container list: %s" % e)
 
 
 def kill_container(cid):