Skip to content

Commit

Permalink
Merge branch 'glacier-storage' into release-1.16.62-customizations
Browse files Browse the repository at this point in the history
  • Loading branch information
joguSD committed Nov 26, 2018
2 parents 67fc7b7 + a1279ea commit bf8859f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
5 changes: 3 additions & 2 deletions awscli/customizations/s3/subcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,12 @@

STORAGE_CLASS = {'name': 'storage-class',
'choices': ['STANDARD', 'REDUCED_REDUNDANCY', 'STANDARD_IA',
'ONEZONE_IA', 'INTELLIGENT_TIERING'],
'ONEZONE_IA', 'INTELLIGENT_TIERING', 'GLACIER'],
'help_text': (
"The type of storage to use for the object. "
"Valid choices are: STANDARD | REDUCED_REDUNDANCY "
"| STANDARD_IA | ONEZONE_IA | INTELLIGENT_TIERING. "
"| STANDARD_IA | ONEZONE_IA | INTELLIGENT_TIERING "
"| GLACIER. "
"Defaults to 'STANDARD'")}


Expand Down
15 changes: 15 additions & 0 deletions tests/functional/s3/test_cp_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,21 @@ def test_upload_intelligent_tiering(self):
self.assertEqual(args['Bucket'], 'bucket')
self.assertEqual(args['StorageClass'], 'INTELLIGENT_TIERING')

def test_upload_glacier(self):
full_path = self.files.create_file('foo.txt', 'mycontent')
cmdline = ('%s %s s3://bucket/key.txt --storage-class GLACIER' %
(self.prefix, full_path))
self.parsed_responses = \
[{'ETag': '"c8afdb36c52cf4727836669019e69222"'}]
self.run_cmd(cmdline, expected_rc=0)
self.assertEqual(len(self.operations_called), 1,
self.operations_called)
self.assertEqual(self.operations_called[0][0].name, 'PutObject')
args = self.operations_called[0][1]
self.assertEqual(args['Key'], 'key.txt')
self.assertEqual(args['Bucket'], 'bucket')
self.assertEqual(args['StorageClass'], 'GLACIER')

def test_operations_used_in_download_file(self):
self.parsed_responses = [
{"ContentLength": "100", "LastModified": "00:00:00Z"},
Expand Down

0 comments on commit bf8859f

Please sign in to comment.