Browse code

cannot use both --cf-invalidate and --add-destination

Matt Domsch authored on 2012/07/31 09:59:54
Showing 1 changed files
... ...
@@ -961,7 +961,7 @@ def cmd_sync_local2remote(args):
961 961
             (pid, status) = os.wait()
962 962
             child_pids.remove(pid)
963 963
 
964
-        return destination_base_uri
964
+        return
965 965
 
966 966
     def _child(destination_base, local_list):
967 967
         def _set_remote_uri(local_list, destination_base, single_file_local):
... ...
@@ -1113,14 +1113,15 @@ def cmd_sync_local2remote(args):
1113 1113
 
1114 1114
     if 'fork' not in os.__all__ or len(destinations) < 2:
1115 1115
         destination_base_uri = _single_process(local_list)
1116
+        if cfg.invalidate_on_cf:
1117
+            if len(uploaded_objects_list) == 0:
1118
+                info("Nothing to invalidate in CloudFront")
1119
+            else:
1120
+                _invalidate_on_cf(destination_base_uri)
1116 1121
     else:
1117
-        destination_base_uri = _parent() # this only returns the last destination
1118
-
1119
-    if cfg.invalidate_on_cf:
1120
-        if len(uploaded_objects_list) == 0:
1121
-            info("Nothing to invalidate in CloudFront")
1122
-        else:
1123
-            _invalidate_on_cf(destination_base_uri)
1122
+        _parent()
1123
+        if cfg.invalidate_on_cf:
1124
+            error(u"You cannot use both --cf-invalidate and --add-destination.")
1124 1125
 
1125 1126
 def cmd_sync(args):
1126 1127
     if (len(args) < 2):