diff -Nru awscli-1.11.117/awscli/alias.py awscli-1.11.121/awscli/alias.py --- awscli-1.11.117/awscli/alias.py 2017-07-06 21:47:05.000000000 +0000 +++ awscli-1.11.121/awscli/alias.py 2017-07-17 21:12:37.000000000 +0000 @@ -17,6 +17,7 @@ from botocore.configloader import raw_config_parse +from awscli.compat import compat_shell_quote from awscli.commands import CLICommand from awscli.utils import emit_top_level_args_parsed_event @@ -274,7 +275,7 @@ command_components = [ self._alias_value[1:] ] - command_components.extend(args) + command_components.extend(compat_shell_quote(a) for a in args) command = ' '.join(command_components) LOG.debug( 'Using external alias %r with value: %r to run: %r', diff -Nru awscli-1.11.117/awscli/compat.py awscli-1.11.121/awscli/compat.py --- awscli-1.11.117/awscli/compat.py 2017-07-06 21:47:05.000000000 +0000 +++ awscli-1.11.121/awscli/compat.py 2017-07-17 21:12:37.000000000 +0000 @@ -179,3 +179,81 @@ sys.stdout.write(prompt) sys.stdout.flush() return raw_input() + + +def compat_shell_quote(s, platform=None): + """Return a shell-escaped version of the string *s* + + Unfortunately `shlex.quote` doesn't support Windows, so this method + provides that functionality. + """ + if platform is None: + platform = sys.platform + + if platform == "win32": + return _windows_shell_quote(s) + else: + return shlex_quote(s) + + +def _windows_shell_quote(s): + """Return a Windows shell-escaped version of the string *s* + + Windows has potentially bizarre rules depending on where you look. When + spawning a process via the Windows C runtime the rules are as follows: + + https://docs.microsoft.com/en-us/cpp/cpp/parsing-cpp-command-line-arguments + + To summarize the relevant bits: + + * Only space and tab are valid delimiters + * Double quotes are the only valid quotes + * Backslash is interpreted literally unless it is part of a chain that + leads up to a double quote. Then the backslashes escape the backslashes, + and if there is an odd number the final backslash escapes the quote. + + :param s: A string to escape + :return: An escaped string + """ + if not s: + return '""' + + buff = [] + num_backspaces = 0 + for character in s: + if character == '\\': + # We can't simply append backslashes because we don't know if + # they will need to be escaped. Instead we separately keep track + # of how many we've seen. + num_backspaces += 1 + elif character == '"': + if num_backspaces > 0: + # The backslashes are part of a chain that lead up to a + # double quote, so they need to be escaped. + buff.append('\\' * (num_backspaces * 2)) + num_backspaces = 0 + + # The double quote also needs to be escaped. The fact that we're + # seeing it at all means that it must have been escaped in the + # original source. + buff.append('\\"') + else: + if num_backspaces > 0: + # The backslashes aren't part of a chain leading up to a + # double quote, so they can be inserted directly without + # being escaped. + buff.append('\\' * num_backspaces) + num_backspaces = 0 + buff.append(character) + + # There may be some leftover backspaces if they were on the trailing + # end, so they're added back in here. + if num_backspaces > 0: + buff.append('\\' * num_backspaces) + + new_s = ''.join(buff) + if ' ' in new_s or '\t' in new_s: + # If there are any spaces or tabs then the string needs to be double + # quoted. + return '"%s"' % new_s + return new_s diff -Nru awscli-1.11.117/awscli/customizations/cloudformation/deployer.py awscli-1.11.121/awscli/customizations/cloudformation/deployer.py --- awscli-1.11.117/awscli/customizations/cloudformation/deployer.py 2017-07-06 21:47:05.000000000 +0000 +++ awscli-1.11.121/awscli/customizations/cloudformation/deployer.py 2017-07-17 21:12:37.000000000 +0000 @@ -124,8 +124,8 @@ # Wait for changeset to be created waiter = self._client.get_waiter("change_set_create_complete") - # Poll every 10 seconds. Changeset creation should be fast - waiter.config.delay = 10 + # Poll every 5 seconds. Changeset creation should be fast + waiter.config.delay = 5 try: waiter.wait(ChangeSetName=changeset_id, StackName=stack_name) except botocore.exceptions.WaiterError as ex: @@ -169,6 +169,10 @@ raise RuntimeError("Invalid changeset type {0}" .format(changeset_type)) + # Poll every 5 seconds. Optimizing for the case when the stack has only + # minimal changes, such the Code for Lambda Function + waiter.config.delay = 5 + try: waiter.wait(StackName=stack_name) except botocore.exceptions.WaiterError as ex: diff -Nru awscli-1.11.117/awscli/customizations/cloudformation/yamlhelper.py awscli-1.11.121/awscli/customizations/cloudformation/yamlhelper.py --- awscli-1.11.117/awscli/customizations/cloudformation/yamlhelper.py 2017-07-06 21:47:05.000000000 +0000 +++ awscli-1.11.121/awscli/customizations/cloudformation/yamlhelper.py 2017-07-17 21:12:37.000000000 +0000 @@ -10,11 +10,12 @@ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF # ANY KIND, either express or implied. See the License for the specific # language governing permissions and limitations under the License. - +import json import yaml -from awscli.compat import six from yaml.resolver import ScalarNode, SequenceNode +from awscli.compat import six + def intrinsics_multi_constructor(loader, tag_prefix, node): """ @@ -63,7 +64,13 @@ def yaml_parse(yamlstr): - - yaml.SafeLoader.add_multi_constructor("!", intrinsics_multi_constructor) - - return yaml.safe_load(yamlstr) + """Parse a yaml string""" + try: + # PyYAML doesn't support json as well as it should, so if the input + # is actually just json it is better to parse it with the standard + # json parser. + return json.loads(yamlstr) + except ValueError: + yaml.SafeLoader.add_multi_constructor( + "!", intrinsics_multi_constructor) + return yaml.safe_load(yamlstr) diff -Nru awscli-1.11.117/awscli/__init__.py awscli-1.11.121/awscli/__init__.py --- awscli-1.11.117/awscli/__init__.py 2017-07-06 21:47:05.000000000 +0000 +++ awscli-1.11.121/awscli/__init__.py 2017-07-17 21:12:38.000000000 +0000 @@ -17,7 +17,7 @@ """ import os -__version__ = '1.11.117' +__version__ = '1.11.121' # # Get our data path to be added to botocore's search path diff -Nru awscli-1.11.117/awscli.egg-info/PKG-INFO awscli-1.11.121/awscli.egg-info/PKG-INFO --- awscli-1.11.117/awscli.egg-info/PKG-INFO 2017-07-06 21:47:06.000000000 +0000 +++ awscli-1.11.121/awscli.egg-info/PKG-INFO 2017-07-17 21:12:38.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: awscli -Version: 1.11.117 +Version: 1.11.121 Summary: Universal Command Line Environment for AWS. Home-page: http://aws.amazon.com/cli/ Author: Amazon Web Services diff -Nru awscli-1.11.117/awscli.egg-info/requires.txt awscli-1.11.121/awscli.egg-info/requires.txt --- awscli-1.11.117/awscli.egg-info/requires.txt 2017-07-06 21:47:06.000000000 +0000 +++ awscli-1.11.121/awscli.egg-info/requires.txt 2017-07-17 21:12:38.000000000 +0000 @@ -1,9 +1,9 @@ -botocore==1.5.80 -colorama>=0.2.5,<=0.3.7 +botocore==1.5.84 +colorama<=0.3.7,>=0.2.5 docutils>=0.10 -rsa>=3.1.2,<=3.5.0 -s3transfer>=0.1.9,<0.2.0 -PyYAML>=3.10,<=3.12 +rsa<=3.5.0,>=3.1.2 +s3transfer<0.2.0,>=0.1.9 +PyYAML<=3.12,>=3.10 [:python_version=="2.6"] argparse>=1.1 diff -Nru awscli-1.11.117/debian/changelog awscli-1.11.121/debian/changelog --- awscli-1.11.117/debian/changelog 2017-07-10 08:06:23.000000000 +0000 +++ awscli-1.11.121/debian/changelog 2017-07-19 10:03:44.000000000 +0000 @@ -1,3 +1,9 @@ +awscli (1.11.121-1) unstable; urgency=medium + + * New upstream version 1.11.121 + + -- TANIGUCHI Takaki Wed, 19 Jul 2017 19:03:44 +0900 + awscli (1.11.117-1) unstable; urgency=medium * New upstream version 1.11.117 (Closes: #865213) diff -Nru awscli-1.11.117/PKG-INFO awscli-1.11.121/PKG-INFO --- awscli-1.11.117/PKG-INFO 2017-07-06 21:47:06.000000000 +0000 +++ awscli-1.11.121/PKG-INFO 2017-07-17 21:12:38.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: awscli -Version: 1.11.117 +Version: 1.11.121 Summary: Universal Command Line Environment for AWS. Home-page: http://aws.amazon.com/cli/ Author: Amazon Web Services diff -Nru awscli-1.11.117/setup.cfg awscli-1.11.121/setup.cfg --- awscli-1.11.117/setup.cfg 2017-07-06 21:47:06.000000000 +0000 +++ awscli-1.11.121/setup.cfg 2017-07-17 21:12:38.000000000 +0000 @@ -3,7 +3,7 @@ [metadata] requires-dist = - botocore==1.5.80 + botocore==1.5.84 colorama>=0.2.5,<=0.3.7 docutils>=0.10 rsa>=3.1.2,<=3.5.0 diff -Nru awscli-1.11.117/setup.py awscli-1.11.121/setup.py --- awscli-1.11.117/setup.py 2017-07-06 21:47:05.000000000 +0000 +++ awscli-1.11.121/setup.py 2017-07-17 21:12:38.000000000 +0000 @@ -23,7 +23,7 @@ raise RuntimeError("Unable to find version string.") -requires = ['botocore==1.5.80', +requires = ['botocore==1.5.84', 'colorama>=0.2.5,<=0.3.7', 'docutils>=0.10', 'rsa>=3.1.2,<=3.5.0',