From e0b7bcb6b7b6f85ffd69282d67a400f3cc7a88bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 20 May 2016 11:57:10 +0200 Subject: [PATCH] Fix renaming file without variations. This used to produce a KeyError. --- pillar/application/utils/gcs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pillar/application/utils/gcs.py b/pillar/application/utils/gcs.py index f715c6ce..8825a521 100644 --- a/pillar/application/utils/gcs.py +++ b/pillar/application/utils/gcs.py @@ -172,7 +172,7 @@ def update_file_name(node): storage.update_name(blob, name) # Assign the same name to variations - for v in file_doc['variations']: + for v in file_doc.get('variations', []): _, override_ext = os.path.splitext(v['file_path']) name = _format_name(node['name'], override_ext, v['size'], map_type=map_type) blob = storage.Get(v['file_path'], to_dict=False)