Skip to content

Commit

Permalink
Merge branch 'release-1.11.124'
Browse files Browse the repository at this point in the history
* release-1.11.124:
  Bumping version to 1.11.124
  Update changelog based on model updates
  Use unicode in result printer
  fixes query parsing in example
  Tweak wording per PR comments
  Improve the pagination help
  • Loading branch information
awstools committed Jul 24, 2017
2 parents 411acd4 + 1922c4a commit 34ab657
Show file tree
Hide file tree
Showing 10 changed files with 139 additions and 20 deletions.
12 changes: 12 additions & 0 deletions .changes/1.11.124.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"category": "``ec2``",
"description": "Update ec2 command to latest version",
"type": "api-change"
},
{
"category": "``appstream``",
"description": "Update appstream command to latest version",
"type": "api-change"
}
]
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
CHANGELOG
=========

1.11.124
========

* api-change:``ec2``: Update ec2 command to latest version
* api-change:``appstream``: Update appstream command to latest version


1.11.123
========

Expand Down
2 changes: 1 addition & 1 deletion awscli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"""
import os

__version__ = '1.11.123'
__version__ = '1.11.124'

#
# Get our data path to be added to botocore's search path
Expand Down
32 changes: 25 additions & 7 deletions awscli/customizations/paginate.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,37 @@
STARTING_TOKEN_HELP = """
<p>A token to specify where to start paginating. This is the
<code>NextToken</code> from a previously truncated response.</p>
<p>For usage examples, see <a
href="https://docs.aws.amazon.com/cli/latest/userguide/pagination.html"
>Pagination</a> in the <i>AWS Command Line Interface User
Guide</i>.</p>
"""

MAX_ITEMS_HELP = """
<p>The total number of items to return. If the total number
of items available is more than the value specified in
max-items then a <code>NextToken</code> will
be provided in the output that you can use to resume pagination.
This <code>NextToken</code> response element should <b>not</b> be
used directly outside of the AWS CLI.</p>
<p>The total number of items to return in the command's output.
If the total number of items available is more than the value
specified, a <code>NextToken</code> is provided in the command's
output. To resume pagination, provide the
<code>NextToken</code> value in the <code>starting-token</code>
argument of a subsequent command. <b>Do not</b> use the
<code>NextToken</code> response element directly outside of the
AWS CLI.</p>
<p>For usage examples, see <a
href="https://docs.aws.amazon.com/cli/latest/userguide/pagination.html"
>Pagination</a> in the <i>AWS Command Line Interface User
Guide</i>.</p>
"""

PAGE_SIZE_HELP = """
<p>The size of each page.<p>
<p>The size of each page to get in the AWS service call. This
does not affect the number of items returned in the command's
output. Setting a smaller page size results in more calls to
the AWS service, retrieving fewer items in each call. This can
help prevent the AWS service calls from timing out.</p>
<p>For usage examples, see <a
href="https://docs.aws.amazon.com/cli/latest/userguide/pagination.html"
>Pagination</a> in the <i>AWS Command Line Interface User
Guide</i>.</p>
"""


Expand Down
14 changes: 7 additions & 7 deletions awscli/customizations/s3/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,24 +353,24 @@ class ResultPrinter(BaseResultHandler):
'Completed {files_completed} file(s) with ' + _FILES_REMAINING
)
SUCCESS_FORMAT = (
'{transfer_type}: {transfer_location}'
u'{transfer_type}: {transfer_location}'
)
DRY_RUN_FORMAT = '(dryrun) ' + SUCCESS_FORMAT
DRY_RUN_FORMAT = u'(dryrun) ' + SUCCESS_FORMAT
FAILURE_FORMAT = (
'{transfer_type} failed: {transfer_location} {exception}'
u'{transfer_type} failed: {transfer_location} {exception}'
)
# TODO: Add "warning: " prefix once all commands are converted to using
# result printer and remove "warning: " prefix from ``create_warning``.
WARNING_FORMAT = (
'{message}'
u'{message}'
)
ERROR_FORMAT = (
'fatal error: {exception}'
u'fatal error: {exception}'
)
CTRL_C_MSG = 'cancelled: ctrl-c received'

SRC_DEST_TRANSFER_LOCATION_FORMAT = '{src} to {dest}'
SRC_TRANSFER_LOCATION_FORMAT = '{src}'
SRC_DEST_TRANSFER_LOCATION_FORMAT = u'{src} to {dest}'
SRC_TRANSFER_LOCATION_FORMAT = u'{src}'

def __init__(self, result_recorder, out_file=None, error_file=None):
"""Prints status of ongoing transfer
Expand Down
4 changes: 2 additions & 2 deletions awscli/examples/ecr/get-authorization-token.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ returns the decoded password for you to use in a ``docker login`` command.
Command::

aws ecr get-authorization-token --output text \
--query authorizationData[].authorizationToken \
| base64 -d | cut -d: -f2
--query 'authorizationData[].authorizationToken' \
| base64 -D | cut -d: -f2


**To `docker login` with your decoded password**
Expand Down
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
# The short X.Y version.
version = '1.11.1'
# The full version, including alpha/beta/rc tags.
release = '1.11.123'
release = '1.11.124'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ universal = 1

[metadata]
requires-dist =
botocore==1.5.86
botocore==1.5.87
colorama>=0.2.5,<=0.3.7
docutils>=0.10
rsa>=3.1.2,<=3.5.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def find_version(*file_paths):
raise RuntimeError("Unable to find version string.")


requires = ['botocore==1.5.86',
requires = ['botocore==1.5.87',
'colorama>=0.2.5,<=0.3.7',
'docutils>=0.10',
'rsa>=3.1.2,<=3.5.0',
Expand Down
82 changes: 82 additions & 0 deletions tests/unit/customizations/s3/test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,88 @@ def test_final_total_does_not_print_out_newline_for_no_transfers(self):
self.result_printer(FinalTotalSubmissionsResult(0))
self.assertEqual(self.out_file.getvalue(), '')

def test_print_unicode_success_src_and_dest(self):
# Pretend that this is the final result in the result queue that
# is processed.
self.result_recorder.final_expected_files_transferred = 1
self.result_recorder.expected_files_transferred = 1
self.result_recorder.files_transferred = 1

result = SuccessResult(
transfer_type='upload',
src=u'/tmp/\u2713',
dest='s3://mybucket/mykey'
)
self.result_printer(result)
expected = u'upload: /tmp/\u2713 to s3://mybucket/mykey\n'
self.assertEqual(self.out_file.getvalue(), expected)

def test_print_unicode_success_src(self):
# Pretend that this is the final result in the result queue that
# is processed.
self.result_recorder.final_expected_files_transferred = 1
self.result_recorder.expected_files_transferred = 1
self.result_recorder.files_transferred = 1

result = SuccessResult(
transfer_type='delete',
src=u's3://mybucket/tmp/\u2713',
dest=None
)
self.result_printer(result)
expected = u'delete: s3://mybucket/tmp/\u2713\n'
self.assertEqual(self.out_file.getvalue(), expected)

def test_print_unicode_dryrun(self):
result = DryRunResult(
transfer_type='upload',
src=u's3://mybucket/\u2713',
dest='./local/file'
)
self.result_printer(result)
expected = u'(dryrun) upload: s3://mybucket/\u2713 to ./local/file\n'
self.assertEqual(self.out_file.getvalue(), expected)

def test_print_unicode_failure(self):
transfer_type = 'upload'
src = u'\u2713'
dest = 's3://mybucket/mykey'

# Pretend that this is the final result in the result queue that
# is processed.
self.result_recorder.final_expected_files_transferred = 1
self.result_recorder.expected_files_transferred = 1
self.result_recorder.files_transferred = 1

failure_result = FailureResult(
transfer_type=transfer_type, src=src, dest=dest,
exception=Exception('my exception'))

self.result_printer(failure_result)

ref_failure_statement = (
u'upload failed: \u2713 to s3://mybucket/mykey my exception\n'
)
self.assertEqual(self.error_file.getvalue(), ref_failure_statement)
self.assertEqual(self.out_file.getvalue(), '')

def test_print_unicode_warning(self):
# Pretend that this is the final result in the result queue that
# is processed.
self.result_recorder.final_expected_files_transferred = 1
self.result_recorder.expected_files_transferred = 1
self.result_recorder.files_transferred = 1

self.result_printer(WarningResult(u'warning: unicode exists \u2713'))
ref_warning_statement = u'warning: unicode exists \u2713\n'
self.assertEqual(self.error_file.getvalue(), ref_warning_statement)
self.assertEqual(self.out_file.getvalue(), '')

def test_print_unicode_error(self):
self.result_printer(ErrorResult(Exception('unicode exists \u2713')))
ref_error_statement = 'fatal error: unicode exists \u2713\n'
self.assertEqual(self.error_file.getvalue(), ref_error_statement)


class TestOnlyShowErrorsResultPrinter(BaseResultPrinterTest):
def setUp(self):
Expand Down

0 comments on commit 34ab657

Please sign in to comment.