From 1732b8a7a98f063c7ebe52c61819112815dc560c Mon Sep 17 00:00:00 2001 From: kyleknap Date: Mon, 23 Feb 2015 09:45:05 -0800 Subject: [PATCH 1/6] Remove unnecessary --recursive from sync command --- CHANGELOG.rst | 9 +++++++++ awscli/customizations/s3/subcommands.py | 7 ++++--- tests/unit/customizations/s3/test_sync_command.py | 5 +++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6786748ee34c..fe01b4eadfb2 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,15 @@ CHANGELOG ========= +Next Release (TBD) +================== + +* bugfix:``aws s3 sync``: Remove ``--recursive`` parameter. The ``sync`` + command is always a recursive operation meaning the inclusion or + exclusion of ``--recursive`` had no effect on the ``sync`` command. + (`issue 1171 `__) + + 1.7.11 ====== diff --git a/awscli/customizations/s3/subcommands.py b/awscli/customizations/s3/subcommands.py index ef3a31e9299e..4ceda142a742 100644 --- a/awscli/customizations/s3/subcommands.py +++ b/awscli/customizations/s3/subcommands.py @@ -253,7 +253,7 @@ 'Using a lower value may help if an operation times out.')} -TRANSFER_ARGS = [DRYRUN, QUIET, RECURSIVE, INCLUDE, EXCLUDE, ACL, +TRANSFER_ARGS = [DRYRUN, QUIET, INCLUDE, EXCLUDE, ACL, FOLLOW_SYMLINKS, NO_FOLLOW_SYMLINKS, NO_GUESS_MIME_TYPE, SSE, STORAGE_CLASS, GRANTS, WEBSITE_REDIRECT, CONTENT_TYPE, CACHE_CONTROL, CONTENT_DISPOSITION, CONTENT_ENCODING, @@ -526,7 +526,8 @@ class CpCommand(S3TransferCommand): USAGE = " or " \ "or " ARG_TABLE = [{'name': 'paths', 'nargs': 2, 'positional_arg': True, - 'synopsis': USAGE}] + TRANSFER_ARGS + [EXPECTED_SIZE] + 'synopsis': USAGE}] + TRANSFER_ARGS + \ + [EXPECTED_SIZE, RECURSIVE] EXAMPLES = BasicCommand.FROM_FILE('s3/cp.rst') @@ -537,7 +538,7 @@ class MvCommand(S3TransferCommand): USAGE = " or " \ "or " ARG_TABLE = [{'name': 'paths', 'nargs': 2, 'positional_arg': True, - 'synopsis': USAGE}] + TRANSFER_ARGS + 'synopsis': USAGE}] + TRANSFER_ARGS + [RECURSIVE] EXAMPLES = BasicCommand.FROM_FILE('s3/mv.rst') diff --git a/tests/unit/customizations/s3/test_sync_command.py b/tests/unit/customizations/s3/test_sync_command.py index a1eb5cadc2dd..4066d514de04 100644 --- a/tests/unit/customizations/s3/test_sync_command.py +++ b/tests/unit/customizations/s3/test_sync_command.py @@ -49,3 +49,8 @@ def test_website_redirect_ignore_paramfile(self): self.operations_called[1][1]['website_redirect_location'], 'http://someserver' ) + + def test_no_recursive_option(self): + cmdline = '. s3://mybucket --recursive' + # Return code will be 2 for invalid parameter ``--recursive`` + self.run_cmd(cmdline, expected_rc=2) From ccbd0b1b8a1684aacd7cc381ee3cc9de33852e6b Mon Sep 17 00:00:00 2001 From: James Saryerwinnie Date: Mon, 23 Feb 2015 10:06:27 -0800 Subject: [PATCH 2/6] Honor --endpoint-url in s3/s3api commands Fixes #1142. The issue was that the before-auth event was removed in the internal botocore auth refactor (between 1.7.4-1.7.5), but this handler was not updated. I've added an integration test that should catch this issue in the future. --- awscli/customizations/s3endpoint.py | 2 +- .../customizations/s3/test_plugin.py | 20 +++++++++++++++++++ tests/unit/customizations/test_s3endpoint.py | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/awscli/customizations/s3endpoint.py b/awscli/customizations/s3endpoint.py index e51a85b7e939..dd1469657978 100644 --- a/awscli/customizations/s3endpoint.py +++ b/awscli/customizations/s3endpoint.py @@ -42,4 +42,4 @@ def on_top_level_args_parsed(parsed_args, event_handler, **kwargs): # is disabled. if parsed_args.command in ['s3', 's3api'] and \ parsed_args.endpoint_url is not None: - event_handler.unregister('before-auth.s3', fix_s3_host) + event_handler.unregister('before-sign.s3', fix_s3_host) diff --git a/tests/integration/customizations/s3/test_plugin.py b/tests/integration/customizations/s3/test_plugin.py index 628041e75a61..71674d7e51cf 100644 --- a/tests/integration/customizations/s3/test_plugin.py +++ b/tests/integration/customizations/s3/test_plugin.py @@ -1636,5 +1636,25 @@ def test_no_sign_request(self): self.assert_no_errors(p) +class TestHonorsEndpointUrl(BaseS3CLICommand): + def test_verify_endpoint_url_is_used(self): + # We're going to verify this indirectly by looking at the + # debug logs. The endpoint url we specify should be in the + # debug logs, and the endpoint url that botocore would have + # used if we didn't provide the endpoint-url should not + # be in the debug logs. The other alternative is to actually + # watch what connections are made in the process, which is not + # easy. + p = aws('s3 ls s3://dnscompat/ ' + '--endpoint-url http://localhost:51515 ' + '--debug') + debug_logs = p.stderr + original_hostname = 'dnscompat.s3.amazonaws.com' + expected = 'localhost' + self.assertNotIn(original_hostname, debug_logs, + '--endpoint-url is being ignored in s3 commands.') + self.assertIn(expected, debug_logs) + + if __name__ == "__main__": unittest.main() diff --git a/tests/unit/customizations/test_s3endpoint.py b/tests/unit/customizations/test_s3endpoint.py index 1f83f2e5b129..e36f03bd1fda 100644 --- a/tests/unit/customizations/test_s3endpoint.py +++ b/tests/unit/customizations/test_s3endpoint.py @@ -25,7 +25,7 @@ def test_endpoint_url_unregisters_fix_s3_host(self): args.command = 's3' event_handler = mock.Mock() on_top_level_args_parsed(args, event_handler) - event_handler.unregister.assert_called_with('before-auth.s3', fix_s3_host) + event_handler.unregister.assert_called_with('before-sign.s3', fix_s3_host) def test_unregister_not_called_for_no_endpoint(self): args = mock.Mock() From 043d5a967395f1b4396ea7ace66582d7ff2762ca Mon Sep 17 00:00:00 2001 From: James Saryerwinnie Date: Mon, 23 Feb 2015 10:17:12 -0800 Subject: [PATCH 3/6] Add #1172 to the changelog --- CHANGELOG.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index fe01b4eadfb2..74426dc6c5a1 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -9,6 +9,8 @@ Next Release (TBD) command is always a recursive operation meaning the inclusion or exclusion of ``--recursive`` had no effect on the ``sync`` command. (`issue 1171 `__) +* bugfix:``aws s3``: Fix issue where ``--endpoint-url`` was being ignored + (`issue 1142 `__) 1.7.11 From c1a7be2e2131c3256540c83a0141a2a4ec0d9ecd Mon Sep 17 00:00:00 2001 From: kyleknap Date: Mon, 23 Feb 2015 10:34:22 -0800 Subject: [PATCH 4/6] Bumped CLI dependancy of bcdoc --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4f99b366b0f5..46bd09a4d232 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ requires = ['botocore>=0.92.0,<0.93.0', - 'bcdoc>=0.12.0,<0.13.0', + 'bcdoc>=0.13.0,<0.14.0', 'colorama>=0.2.5,<=0.3.3', 'docutils>=0.10', 'rsa>=3.1.2,<=3.1.4'] From 2366bbfda8ae4d0441fe5b91a6fea0b6e9c0c7c2 Mon Sep 17 00:00:00 2001 From: kyleknap Date: Mon, 23 Feb 2015 15:48:41 -0800 Subject: [PATCH 5/6] Update changelog with service updates --- CHANGELOG.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 74426dc6c5a1..2ec26a04db0a 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,9 @@ CHANGELOG Next Release (TBD) ================== +* feature:``aws datapipeline``: Add support for tagging. +* feature:``aws route53``: Add support for listing hosted zones by name and + getting the hosted zone count. * bugfix:``aws s3 sync``: Remove ``--recursive`` parameter. The ``sync`` command is always a recursive operation meaning the inclusion or exclusion of ``--recursive`` had no effect on the ``sync`` command. From 631ab7decd0953966e11432d18b1d605a709ae60 Mon Sep 17 00:00:00 2001 From: AWS Date: Mon, 23 Feb 2015 16:49:57 -0800 Subject: [PATCH 6/6] Bumping version to 1.7.12 --- CHANGELOG.rst | 4 ++-- awscli/__init__.py | 2 +- doc/source/conf.py | 2 +- setup.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2ec26a04db0a..602c84a1160c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,8 +2,8 @@ CHANGELOG ========= -Next Release (TBD) -================== +1.7.12 +====== * feature:``aws datapipeline``: Add support for tagging. * feature:``aws route53``: Add support for listing hosted zones by name and diff --git a/awscli/__init__.py b/awscli/__init__.py index 182dc19c888c..6e57a97734eb 100644 --- a/awscli/__init__.py +++ b/awscli/__init__.py @@ -17,7 +17,7 @@ """ import os -__version__ = '1.7.11' +__version__ = '1.7.12' # # Get our data path to be added to botocore's search path diff --git a/doc/source/conf.py b/doc/source/conf.py index 36452a2999a9..072f9d934c43 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -52,7 +52,7 @@ # The short X.Y version. version = '1.7.' # The full version, including alpha/beta/rc tags. -release = '1.7.11' +release = '1.7.12' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.py b/setup.py index 46bd09a4d232..72eb27dec0f3 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ import awscli -requires = ['botocore>=0.92.0,<0.93.0', +requires = ['botocore>=0.93.0,<0.94.0', 'bcdoc>=0.13.0,<0.14.0', 'colorama>=0.2.5,<=0.3.3', 'docutils>=0.10',