diff options
author | Jenkins <jenkins@review.openstack.org> | 2012-06-27 19:30:15 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2012-06-27 19:30:15 +0000 |
commit | 2e05673e5ca618423ea19dad59c1b43ad0016c04 (patch) | |
tree | 6429aaaf00376f1d78dfe88d019cdbeb821601d4 | |
parent | 8396e3a4cb3daa6946844c23af22e01f44671834 (diff) | |
parent | 6119de7e0b92739549a5ce52142c9bc78dd9e589 (diff) | |
download | python-swiftclient-2e05673e5ca618423ea19dad59c1b43ad0016c04.tar.gz |
Merge "Make CLI exit nonzero on error."
-rwxr-xr-x | bin/swift | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1041,9 +1041,12 @@ Example: print_thread = QueueFunctionThread(print_queue, _print) print_thread.start() + error_count = 0 error_queue = Queue(10000) def _error(item): + global error_count + error_count += 1 if isinstance(item, unicode): item = item.encode('utf8') print >> stderr, item @@ -1068,6 +1071,8 @@ Example: error_thread.abort = True while error_thread.isAlive(): error_thread.join(0.01) + if error_count: + exit(1) except (SystemExit, Exception): for thread in threading_enumerate(): thread.abort = True |