diff options
author | Jiří Suchomel <jsuchome@suse.cz> | 2014-09-29 22:13:06 +0200 |
---|---|---|
committer | Jiří Suchomel <jsuchome@suse.cz> | 2014-10-01 17:24:11 +0200 |
commit | 21fb6f6798015f9f3b9744cf660bdf01822f4b54 (patch) | |
tree | b2f2207c955a205c8fc46d31f734b9dbf944001c | |
parent | bb4d2ab59c4de9389667eeed255642f51e276f1e (diff) | |
download | python-swiftclient-21fb6f6798015f9f3b9744cf660bdf01822f4b54.tar.gz |
Do not crash with "swift list --lh" for Ceph RadosGW.
If 'x-timestamp' header is not present in 'swift list' result,
date string cannot be correctly generated. Check for correct
exception to catch this case and return a special string value.
This is just a workaround for faulty RadosGW behavior.
Change-Id: I172843a2668e33efac00924906ff0dca3e790050
Closes-Bug: 1349528
-rwxr-xr-x | swiftclient/shell.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/swiftclient/shell.py b/swiftclient/shell.py index d0ef8fa..781b84a 100755 --- a/swiftclient/shell.py +++ b/swiftclient/shell.py @@ -421,7 +421,7 @@ def st_list(parser, args, output_manager): float(meta.get('x-timestamp'))) datestamp = strftime( '%Y-%m-%d %H:%M:%S', utc) - except ClientException: + except TypeError: datestamp = '????-??-?? ??:??:??' if not options.totals: output_manager.print_msg( |