File tree Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change 40
40
NeverSync ,
41
41
SizeAndLastModifiedSync ,
42
42
)
43
- from awscli .customizations .s3 .syncstrategy .nooverwrite import NoOverwriteSync
44
43
from awscli .customizations .s3 .utils import (
45
44
AppendFilter ,
46
45
RequestParamsMapper ,
@@ -1297,15 +1296,10 @@ def choose_sync_strategies(self):
1297
1296
of its self when the event is emitted.
1298
1297
"""
1299
1298
sync_strategies = {}
1300
- if self .parameters .get ('no_overwrite' ):
1301
- sync_strategies ['file_at_src_and_dest_sync_strategy' ] = (
1302
- NoOverwriteSync ()
1303
- )
1304
- else :
1305
- # Set the default strategies.
1306
- sync_strategies ['file_at_src_and_dest_sync_strategy' ] = (
1307
- SizeAndLastModifiedSync ()
1308
- )
1299
+ # Set the default strategies.
1300
+ sync_strategies ['file_at_src_and_dest_sync_strategy' ] = (
1301
+ SizeAndLastModifiedSync ()
1302
+ )
1309
1303
sync_strategies ['file_not_at_dest_sync_strategy' ] = MissingFileSync ()
1310
1304
sync_strategies ['file_not_at_src_sync_strategy' ] = NeverSync ()
1311
1305
@@ -1320,7 +1314,6 @@ def choose_sync_strategies(self):
1320
1314
sync_type = override_sync_strategy .sync_type
1321
1315
sync_type += '_sync_strategy'
1322
1316
sync_strategies [sync_type ] = override_sync_strategy
1323
-
1324
1317
return sync_strategies
1325
1318
1326
1319
def run (self ):
Original file line number Diff line number Diff line change 12
12
# language governing permissions and limitations under the License.
13
13
import logging
14
14
15
+ from awscli .customizations .s3 .subcommands import NO_OVERWRITE
15
16
from awscli .customizations .s3 .syncstrategy .base import BaseSync
16
17
17
18
LOG = logging .getLogger (__name__ )
@@ -24,6 +25,8 @@ class NoOverwriteSync(BaseSync):
24
25
overwriting of existing files, regardless of size or modification time differences.
25
26
"""
26
27
28
+ ARGUMENT = NO_OVERWRITE
29
+
27
30
def determine_should_sync (self , src_file , dest_file ):
28
31
LOG .debug (
29
32
f"warning: skipping { src_file .src } -> { src_file .dest } , file exists at destination"
You can’t perform that action at this time.
0 commit comments