Browse code

Merge pull request #938 from Nossnevs/feature/fix_nr_of_paths

Fixes bug in cinvalinfo when only one path is supplied to cloudfront invalidation request.

Florent Viard authored on 2017/12/01 21:56:45
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