Skip to content

Commit

Permalink
Add --page-size argument to the aws s3 rm command
Browse files Browse the repository at this point in the history
The rm command does make a ListObjects call in the recursive case,
so it makes sense to be consistent and support the --page-size argument
for aws s3 rm.
  • Loading branch information
jamesls committed Oct 20, 2014
1 parent 0d68dc7 commit 15d8f4a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion awscli/customizations/s3/subcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ class RmCommand(S3TransferCommand):
USAGE = "<S3Path>"
ARG_TABLE = [{'name': 'paths', 'nargs': 1, 'positional_arg': True,
'synopsis': USAGE}, DRYRUN, QUIET, RECURSIVE, INCLUDE,
EXCLUDE, ONLY_SHOW_ERRORS]
EXCLUDE, ONLY_SHOW_ERRORS, PAGE_SIZE]
EXAMPLES = BasicCommand.FROM_FILE('s3/rm.rst')


Expand Down
10 changes: 10 additions & 0 deletions tests/integration/customizations/s3/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,16 @@ def test_rm_with_newlines(self):
# And verify it's gone.
self.assertFalse(self.key_exists(bucket_name, key_name='foo\r.txt'))

def test_rm_with_page_size(self):
bucket_name = self.create_bucket()
self.put_object(bucket_name, 'foo.txt', contents='hello world')
self.put_object(bucket_name, 'bar.txt', contents='hello world2')
p = aws('s3 rm s3://%s/ --recursive --page-size 1' % bucket_name)
self.assert_no_errors(p)

self.assertFalse(self.key_exists(bucket_name, key_name='foo.txt'))
self.assertFalse(self.key_exists(bucket_name, key_name='bar.txt'))


class TestCp(BaseS3CLICommand):

Expand Down

0 comments on commit 15d8f4a

Please sign in to comment.