Skip to content

Commit 0b32a5b

Browse files
committed
Change default to ignore
1 parent 523befc commit 0b32a5b

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

awscli/customizations/s3/subcommands.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@
491491
'warn',
492492
'error',
493493
],
494-
'default': 'warn',
494+
'default': 'ignore',
495495
'help_text': (
496496
"Configures behavior when attempting to download multiple objects "
497497
"whose keys differ only by case, which can cause undefined behavior "
@@ -502,10 +502,10 @@
502502
"conflicts</a> for details. Valid values are: "
503503
"<ul>"
504504
"<li>``error`` - Raise an error and abort downloads.</li>"
505-
"<li>``warn`` - The default value. Emit a warning and download "
506-
"the object.</li>"
505+
"<li>``warn`` - Emit a warning and download the object.</li>"
507506
"<li>``skip`` - Skip downloading the object.</li>"
508-
"<li>``ignore`` - Ignore the conflict and download the object.</li>"
507+
"<li>``ignore`` - The default value. Ignore the conflict and "
508+
"download the object.</li>"
509509
"</ul>"
510510
),
511511
}

awscli/customizations/s3/syncstrategy/caseconflict.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class CaseConflictSync(BaseSync):
2323
def __init__(
2424
self,
2525
sync_type='file_not_at_dest',
26-
on_case_conflict='warn',
26+
on_case_conflict='ignore',
2727
submitted=None,
2828
):
2929
super().__init__(sync_type)
@@ -59,6 +59,10 @@ def determine_should_sync(self, src_file, dest_file):
5959
src_file.case_conflict_key = lower_compare_key
6060
return should_sync
6161

62+
@staticmethod
63+
def _handle_ignore(src_file):
64+
return True
65+
6266
@staticmethod
6367
def _handle_skip(src_file):
6468
msg = (

awscli/topics/s3-case-insensitivity.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ parameter. The following values are valid options:
4646

4747
* ``error`` - When a case conflict is detected, the command will immediately
4848
fail and abort in-progress downloads.
49-
* ``warn`` - (Default) When a case conflict is detected, the AWS CLI will
49+
* ``warn`` - When a case conflict is detected, the AWS CLI will
5050
display a warning.
5151
* ``skip`` - When a case conflict is detected, the command will skip
5252
downloading the object and continue and display a warning.
53-
* ``ignore`` - Case conflicts will not be detected or handled.
53+
* ``ignore`` - (Default) Case conflicts will not be detected or handled.
5454

5555

5656
Continuing the prior example, the following describes what happens when

tests/functional/s3/test_cp_command.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,6 +1319,19 @@ def test_accepts_mrap_arns_with_slash(self):
13191319
class TestCpRecursiveCaseConflict(TestSyncCaseConflict):
13201320
prefix = 's3 cp --recursive '
13211321

1322+
def test_ignore_by_default(self):
1323+
self.files.create_file(self.lower_key, 'mycontent')
1324+
# Note there's no --case-conflict param.
1325+
cmd = f"{self.prefix} s3://bucket {self.files.rootdir}"
1326+
self.parsed_responses = [
1327+
self.list_objects_response([self.upper_key]),
1328+
self.get_object_response(),
1329+
]
1330+
# Expect success, so not error mode.
1331+
_, stderr, _ = self.run_cmd(cmd, expected_rc=0)
1332+
# No warnings in stderr, so not warn or skip mode.
1333+
assert not stderr
1334+
13221335

13231336
class TestS3ExpressCpRecursive(BaseCPCommandTest):
13241337
prefix = 's3 cp --recursive '

0 commit comments

Comments
 (0)