diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f70016ed3e61..49ccf71eb518 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,9 +5,15 @@ CHANGELOG Next Release (TBD) ================== +* bugfix:``aws s3``: Fix issue with fips-us-gov-west-1 endpoint + (`issue botocore 265 (https://github.com/boto/botocore/pull/265)`__) * bugfix:Table Output: Fix issue when displaying unicode characters in table output (`issue 721 `__) +* bugfix:``aws s3``: Fix regression when syncing files with + whitespace + (`issue 706 `__, + `issue 718 `__) 1.3.4 diff --git a/awscli/customizations/s3/s3.py b/awscli/customizations/s3/s3.py index 2bef40e65b0b..bcd785763bd5 100644 --- a/awscli/customizations/s3/s3.py +++ b/awscli/customizations/s3/s3.py @@ -446,7 +446,7 @@ def _build_website_configuration(self, parsed_args): website_config = {} if parsed_args.index_document is not None: website_config['IndexDocument'] = {'Suffix': parsed_args.index_document} - elif parsed_args.error_document is not None: + if parsed_args.error_document is not None: website_config['ErrorDocument'] = {'Key': parsed_args.error_document} return website_config diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py index ce94dcb47338..fdde49286117 100644 --- a/tests/integration/__init__.py +++ b/tests/integration/__init__.py @@ -84,7 +84,7 @@ def aws(command, collect_memory=False, env_vars=None, aws_command = 'python %s' % AWS_CMD full_command = '%s %s' % (aws_command, command) stdout_encoding = _get_stdout_encoding() - if isinstance(full_command, six.text_type): + if isinstance(full_command, six.text_type) and not six.PY3: full_command = full_command.encode(stdout_encoding) LOG.debug("Running command: %s", full_command) env = os.environ.copy() diff --git a/tests/integration/customizations/s3/test_plugin.py b/tests/integration/customizations/s3/test_plugin.py index 4798f46d56b4..e04fb8e0d1f6 100644 --- a/tests/integration/customizations/s3/test_plugin.py +++ b/tests/integration/customizations/s3/test_plugin.py @@ -718,8 +718,9 @@ def test_transfer_single_large_file(self): class TestWebsiteConfiguration(BaseS3CLICommand): - def test_create_website_configuration(self): + def test_create_website_index_configuration(self): bucket_name = self.create_bucket() + # Supply only --index-document argument. full_command = 's3 website %s --index-document index.html' % (bucket_name) p = aws(full_command) self.assertEqual(p.rc, 0) @@ -729,6 +730,25 @@ def test_create_website_configuration(self): parsed = operation.call( self.endpoint, bucket=bucket_name)[1] self.assertEqual(parsed['IndexDocument']['Suffix'], 'index.html') + self.assertEqual(parsed['ErrorDocument'], {}) + self.assertEqual(parsed['RoutingRules'], []) + self.assertEqual(parsed['RedirectAllRequestsTo'], {}) + + def test_create_website_index_and_error_configuration(self): + bucket_name = self.create_bucket() + # Supply both --index-document and --error-document arguments. + p = aws('s3 website %s --index-document index.html ' + '--error-document error.html' % bucket_name) + self.assertEqual(p.rc, 0) + self.assert_no_errors(p) + # Verify we have a bucket website configured. + operation = self.service.get_operation('GetBucketWebsite') + parsed = operation.call( + self.endpoint, bucket=bucket_name)[1] + self.assertEqual(parsed['IndexDocument']['Suffix'], 'index.html') + self.assertEqual(parsed['ErrorDocument']['Key'], 'error.html') + self.assertEqual(parsed['RoutingRules'], []) + self.assertEqual(parsed['RedirectAllRequestsTo'], {}) class TestIncludeExcludeFilters(BaseS3CLICommand):