summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorNuno Santos <nsantos@apache.org>2010-05-03 21:33:43 +0000
committerNuno Santos <nsantos@apache.org>2010-05-03 21:33:43 +0000
commit6397c46f6716e8904fa3ed84ea8f2d14b6c824ac (patch)
tree1830135b0db1ab5df97f7a8a44190e5f8fb67643 /tools
parentcddeb9a20b1e58886683264bb8ef7c2c5d248e06 (diff)
downloadqpid-python-6397c46f6716e8904fa3ed84ea8f2d14b6c824ac.tar.gz
handle timeouts caused by long-executing commands, iterate until timeout clears
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@940631 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tools')
-rwxr-xr-xtools/src/py/qpid-config19
1 files changed, 15 insertions, 4 deletions
diff --git a/tools/src/py/qpid-config b/tools/src/py/qpid-config
index 24a20b0431..f086ab9ac2 100755
--- a/tools/src/py/qpid-config
+++ b/tools/src/py/qpid-config
@@ -566,7 +566,18 @@ except IOError, e:
print e
sys.exit(1)
except Exception,e:
- print "Failed: %s: %s" % (e.__class__.__name__, e)
- sys.exit(1)
-
-bm.Disconnect()
+ if e.__class__.__name__ != "Timeout":
+ # ignore Timeout exception, handle in the loop below
+ print "Failed: %s: %s" % (e.__class__.__name__, e)
+ sys.exit(1)
+
+while True:
+ # some commands take longer than the default amqp timeout to complete,
+ # so attempt to disconnect until successful, ignoring Timeouts
+ try:
+ bm.Disconnect()
+ break
+ except Exception, e:
+ if e.__class__.__name__ != "Timeout":
+ print "Failed: %s: %s" % (e.__class__.__name__, e)
+ sys.exit(1)