Browse code

Fixes bug when only one path is supplied. Before it displayed the nr of characters in the string.

Mikael Svensson authored on 2017/12/01 17:49:41
Showing 1 changed files
... ...
@@ -783,10 +783,12 @@ class Cmd(object):
783 783
             cfuri = S3Uri(req)
784 784
             inval_info = cf.GetInvalInfo(cfuri)
785 785
             st = inval_info['inval_status'].info
786
+            paths = st['InvalidationBatch']['Path']
787
+            nr_of_paths = len(paths) if isinstance(paths, list) else 1
786 788
             pretty_output("URI", str(cfuri))
787 789
             pretty_output("Status", st['Status'])
788 790
             pretty_output("Created", st['CreateTime'])
789
-            pretty_output("Nr of paths", len(st['InvalidationBatch']['Path']))
791
+            pretty_output("Nr of paths", nr_of_paths)
790 792
             pretty_output("Reference", st['InvalidationBatch']['CallerReference'])
791 793
             output("")
792 794