commit aws-cli for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package aws-cli for openSUSE:Factory checked in at 2022-08-31 18:08:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/aws-cli (Old) and /work/SRC/openSUSE:Factory/.aws-cli.new.2083 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "aws-cli" Wed Aug 31 18:08:48 2022 rev:66 rq:1000022 version:1.25.60 Changes: -------- --- /work/SRC/openSUSE:Factory/aws-cli/aws-cli.changes 2022-08-22 11:05:00.705685690 +0200 +++ /work/SRC/openSUSE:Factory/.aws-cli.new.2083/aws-cli.changes 2022-08-31 18:08:54.579363019 +0200 @@ -1,0 +2,8 @@ +Fri Aug 26 10:13:16 UTC 2022 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com> + +- Update to version 1.25.60 + + For detailed changes see + https://github.com/aws/aws-cli/blob/1.25.60/CHANGELOG.rst +- Update Requires in spec file from setup.py + +------------------------------------------------------------------- Old: ---- 1.25.55.tar.gz New: ---- 1.25.60.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ aws-cli.spec ++++++ --- /var/tmp/diff_new_pack.qw4U1A/_old 2022-08-31 18:08:55.131364479 +0200 +++ /var/tmp/diff_new_pack.qw4U1A/_new 2022-08-31 18:08:55.139364500 +0200 @@ -17,7 +17,7 @@ Name: aws-cli -Version: 1.25.55 +Version: 1.25.60 Release: 0 Summary: Amazon Web Services Command Line Interface License: Apache-2.0 @@ -35,7 +35,7 @@ Requires: python3 Requires: python3-PyYAML <= 6.0.0 Requires: python3-PyYAML >= 3.10 -Requires: python3-botocore >= 1.27.55 +Requires: python3-botocore >= 1.27.60 Requires: python3-colorama <= 0.4.5 Requires: python3-colorama >= 0.2.5 Requires: python3-docutils < 0.20 @@ -52,7 +52,7 @@ Requires: python Requires: python-PyYAML <= 5.5 Requires: python-PyYAML >= 3.10 -Requires: python-botocore >= 1.27.55 +Requires: python-botocore >= 1.27.60 Requires: python-colorama <= 0.4.5 Requires: python-colorama >= 0.2.5 Requires: python-docutils >= 0.10 ++++++ 1.25.55.tar.gz -> 1.25.60.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/.changes/1.25.56.json new/aws-cli-1.25.60/.changes/1.25.56.json --- old/aws-cli-1.25.55/.changes/1.25.56.json 1970-01-01 01:00:00.000000000 +0100 +++ new/aws-cli-1.25.60/.changes/1.25.56.json 2022-08-24 20:11:30.000000000 +0200 @@ -0,0 +1,37 @@ +[ + { + "category": "Endpoints", + "description": "Enforce SSL common name as default endpoint url", + "type": "enhancement" + }, + { + "category": "``chime-sdk-media-pipelines``", + "description": "The Amazon Chime SDK now supports live streaming of real-time video from the Amazon Chime SDK sessions to streaming platforms such as Amazon IVS and Amazon Elemental MediaLive. We have also added support for concatenation to create a single media capture file.", + "type": "api-change" + }, + { + "category": "``cloudwatch``", + "description": "Update cloudwatch command to latest version", + "type": "api-change" + }, + { + "category": "``cognito-idp``", + "description": "This change is being made simply to fix the public documentation based on the models. We have included the PasswordChange and ResendCode events, along with the Pass, Fail and InProgress status. We have removed the Success and Failure status which are never returned by our APIs.", + "type": "api-change" + }, + { + "category": "``dynamodb``", + "description": "This release adds support for importing data from S3 into a new DynamoDB table", + "type": "api-change" + }, + { + "category": "``ec2``", + "description": "This release adds support for VPN log options , a new feature allowing S2S VPN connections to send IKE activity logs to CloudWatch Logs", + "type": "api-change" + }, + { + "category": "``networkmanager``", + "description": "Add TransitGatewayPeeringAttachmentId property to TransitGatewayPeering Model", + "type": "api-change" + } +] \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/.changes/1.25.57.json new/aws-cli-1.25.60/.changes/1.25.57.json --- old/aws-cli-1.25.55/.changes/1.25.57.json 1970-01-01 01:00:00.000000000 +0100 +++ new/aws-cli-1.25.60/.changes/1.25.57.json 2022-08-24 20:11:30.000000000 +0200 @@ -0,0 +1,32 @@ +[ + { + "category": "docs", + "description": "Differentiate between regular and streaming blobs and generate a usage note when a parameter is of streaming blob type.", + "type": "enhancement" + }, + { + "category": "docs", + "description": "Improve AWS CLI docs to include global options available to service commands.", + "type": "enhancement" + }, + { + "category": "``connect``", + "description": "This release adds SearchSecurityProfiles API which can be used to search for Security Profile resources within a Connect Instance.", + "type": "api-change" + }, + { + "category": "``ivschat``", + "description": "Documentation Change for IVS Chat API Reference - Doc-only update to change text/description for tags field.", + "type": "api-change" + }, + { + "category": "``kendra``", + "description": "This release adds support for a new authentication type - Personal Access Token (PAT) for confluence server.", + "type": "api-change" + }, + { + "category": "``lookoutmetrics``", + "description": "This release is to make GetDataQualityMetrics API publicly available.", + "type": "api-change" + } +] \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/.changes/1.25.58.json new/aws-cli-1.25.60/.changes/1.25.58.json --- old/aws-cli-1.25.55/.changes/1.25.58.json 1970-01-01 01:00:00.000000000 +0100 +++ new/aws-cli-1.25.60/.changes/1.25.58.json 2022-08-24 20:11:30.000000000 +0200 @@ -0,0 +1,42 @@ +[ + { + "category": "``docdb``", + "description": "Update document for volume clone", + "type": "api-change" + }, + { + "category": "``ec2``", + "description": "R6a instances are powered by 3rd generation AMD EPYC (Milan) processors delivering all-core turbo frequency of 3.6 GHz. C6id, M6id, and R6id instances are powered by 3rd generation Intel Xeon Scalable processor (Ice Lake) delivering all-core turbo frequency of 3.5 GHz.", + "type": "api-change" + }, + { + "category": "``forecast``", + "description": "releasing What-If Analysis APIs and update ARN regex pattern to be more strict in accordance with security recommendation", + "type": "api-change" + }, + { + "category": "``forecastquery``", + "description": "releasing What-If Analysis APIs", + "type": "api-change" + }, + { + "category": "``iotsitewise``", + "description": "Enable non-unique asset names under different hierarchies", + "type": "api-change" + }, + { + "category": "``lexv2-models``", + "description": "Update lexv2-models command to latest version", + "type": "api-change" + }, + { + "category": "``securityhub``", + "description": "Added new resource details objects to ASFF, including resources for AwsBackupBackupVault, AwsBackupBackupPlan and AwsBackupRecoveryPoint. Added FixAvailable, FixedInVersion and Remediation to Vulnerability.", + "type": "api-change" + }, + { + "category": "``support-app``", + "description": "This is the initial SDK release for the AWS Support App in Slack.", + "type": "api-change" + } +] \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/.changes/1.25.59.json new/aws-cli-1.25.60/.changes/1.25.59.json --- old/aws-cli-1.25.55/.changes/1.25.59.json 1970-01-01 01:00:00.000000000 +0100 +++ new/aws-cli-1.25.60/.changes/1.25.59.json 2022-08-24 20:11:30.000000000 +0200 @@ -0,0 +1,12 @@ +[ + { + "category": "``rds``", + "description": "RDS for Oracle supports Oracle Data Guard switchover and read replica backups.", + "type": "api-change" + }, + { + "category": "``sso-admin``", + "description": "Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On)", + "type": "api-change" + } +] \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/.changes/1.25.60.json new/aws-cli-1.25.60/.changes/1.25.60.json --- old/aws-cli-1.25.55/.changes/1.25.60.json 1970-01-01 01:00:00.000000000 +0100 +++ new/aws-cli-1.25.60/.changes/1.25.60.json 2022-08-24 20:11:30.000000000 +0200 @@ -0,0 +1,32 @@ +[ + { + "category": "``cloudfront``", + "description": "Adds support for CloudFront origin access control (OAC), making it possible to restrict public access to S3 bucket origins in all AWS Regions, those with SSE-KMS, and more.", + "type": "api-change" + }, + { + "category": "``config``", + "description": "AWS Config now supports ConformancePackTemplate documents in SSM Docs for the deployment and update of conformance packs.", + "type": "api-change" + }, + { + "category": "``iam``", + "description": "Documentation updates for AWS Identity and Access Management (IAM).", + "type": "api-change" + }, + { + "category": "``ivs``", + "description": "Documentation Change for IVS API Reference - Doc-only update to type field description for CreateChannel and UpdateChannel actions and for Channel data type. Also added Amazon Resource Names (ARNs) paragraph to Welcome section.", + "type": "api-change" + }, + { + "category": "``quicksight``", + "description": "Added a new optional property DashboardVisual under ExperienceConfiguration parameter of GenerateEmbedUrlForAnonymousUser and GenerateEmbedUrlForRegisteredUser API operations. This supports embedding of specific visuals in QuickSight dashboards.", + "type": "api-change" + }, + { + "category": "``transfer``", + "description": "Documentation updates for AWS Transfer Family", + "type": "api-change" + } +] \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/CHANGELOG.rst new/aws-cli-1.25.60/CHANGELOG.rst --- old/aws-cli-1.25.55/CHANGELOG.rst 2022-08-18 00:52:50.000000000 +0200 +++ new/aws-cli-1.25.60/CHANGELOG.rst 2022-08-24 20:11:30.000000000 +0200 @@ -2,6 +2,60 @@ CHANGELOG ========= +1.25.60 +======= + +* api-change:``cloudfront``: Adds support for CloudFront origin access control (OAC), making it possible to restrict public access to S3 bucket origins in all AWS Regions, those with SSE-KMS, and more. +* api-change:``config``: AWS Config now supports ConformancePackTemplate documents in SSM Docs for the deployment and update of conformance packs. +* api-change:``iam``: Documentation updates for AWS Identity and Access Management (IAM). +* api-change:``ivs``: Documentation Change for IVS API Reference - Doc-only update to type field description for CreateChannel and UpdateChannel actions and for Channel data type. Also added Amazon Resource Names (ARNs) paragraph to Welcome section. +* api-change:``quicksight``: Added a new optional property DashboardVisual under ExperienceConfiguration parameter of GenerateEmbedUrlForAnonymousUser and GenerateEmbedUrlForRegisteredUser API operations. This supports embedding of specific visuals in QuickSight dashboards. +* api-change:``transfer``: Documentation updates for AWS Transfer Family + + +1.25.59 +======= + +* api-change:``rds``: RDS for Oracle supports Oracle Data Guard switchover and read replica backups. +* api-change:``sso-admin``: Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On) + + +1.25.58 +======= + +* api-change:``docdb``: Update document for volume clone +* api-change:``ec2``: R6a instances are powered by 3rd generation AMD EPYC (Milan) processors delivering all-core turbo frequency of 3.6 GHz. C6id, M6id, and R6id instances are powered by 3rd generation Intel Xeon Scalable processor (Ice Lake) delivering all-core turbo frequency of 3.5 GHz. +* api-change:``forecast``: releasing What-If Analysis APIs and update ARN regex pattern to be more strict in accordance with security recommendation +* api-change:``forecastquery``: releasing What-If Analysis APIs +* api-change:``iotsitewise``: Enable non-unique asset names under different hierarchies +* api-change:``lexv2-models``: Update lexv2-models command to latest version +* api-change:``securityhub``: Added new resource details objects to ASFF, including resources for AwsBackupBackupVault, AwsBackupBackupPlan and AwsBackupRecoveryPoint. Added FixAvailable, FixedInVersion and Remediation to Vulnerability. +* api-change:``support-app``: This is the initial SDK release for the AWS Support App in Slack. + + +1.25.57 +======= + +* enhancement:docs: Differentiate between regular and streaming blobs and generate a usage note when a parameter is of streaming blob type. +* enhancement:docs: Improve AWS CLI docs to include global options available to service commands. +* api-change:``connect``: This release adds SearchSecurityProfiles API which can be used to search for Security Profile resources within a Connect Instance. +* api-change:``ivschat``: Documentation Change for IVS Chat API Reference - Doc-only update to change text/description for tags field. +* api-change:``kendra``: This release adds support for a new authentication type - Personal Access Token (PAT) for confluence server. +* api-change:``lookoutmetrics``: This release is to make GetDataQualityMetrics API publicly available. + + +1.25.56 +======= + +* enhancement:Endpoints: Enforce SSL common name as default endpoint url +* api-change:``chime-sdk-media-pipelines``: The Amazon Chime SDK now supports live streaming of real-time video from the Amazon Chime SDK sessions to streaming platforms such as Amazon IVS and Amazon Elemental MediaLive. We have also added support for concatenation to create a single media capture file. +* api-change:``cloudwatch``: Update cloudwatch command to latest version +* api-change:``cognito-idp``: This change is being made simply to fix the public documentation based on the models. We have included the PasswordChange and ResendCode events, along with the Pass, Fail and InProgress status. We have removed the Success and Failure status which are never returned by our APIs. +* api-change:``dynamodb``: This release adds support for importing data from S3 into a new DynamoDB table +* api-change:``ec2``: This release adds support for VPN log options , a new feature allowing S2S VPN connections to send IKE activity logs to CloudWatch Logs +* api-change:``networkmanager``: Add TransitGatewayPeeringAttachmentId property to TransitGatewayPeering Model + + 1.25.55 ======= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/awscli/__init__.py new/aws-cli-1.25.60/awscli/__init__.py --- old/aws-cli-1.25.55/awscli/__init__.py 2022-08-18 00:52:50.000000000 +0200 +++ new/aws-cli-1.25.60/awscli/__init__.py 2022-08-24 20:11:30.000000000 +0200 @@ -17,7 +17,7 @@ """ import os -__version__ = '1.25.55' +__version__ = '1.25.60' # # Get our data path to be added to botocore's search path diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/awscli/bcdoc/docevents.py new/aws-cli-1.25.60/awscli/bcdoc/docevents.py --- old/aws-cli-1.25.55/awscli/bcdoc/docevents.py 2022-08-18 00:52:50.000000000 +0200 +++ new/aws-cli-1.25.60/awscli/bcdoc/docevents.py 2022-08-24 20:11:30.000000000 +0200 @@ -23,6 +23,7 @@ 'doc-option': '.%s.%s', 'doc-option-example': '.%s.%s', 'doc-options-end': '.%s', + 'doc-global-option': '.%s', 'doc-examples': '.%s', 'doc-output': '.%s', 'doc-subitems-start': '.%s', @@ -74,6 +75,8 @@ arg_name=arg_name, help_command=help_command) session.emit('doc-options-end.%s' % help_command.event_class, help_command=help_command) + session.emit('doc-global-option.%s' % help_command.event_class, + help_command=help_command) session.emit('doc-subitems-start.%s' % help_command.event_class, help_command=help_command) if help_command.command_table: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/awscli/bcdoc/restdoc.py new/aws-cli-1.25.60/awscli/bcdoc/restdoc.py --- old/aws-cli-1.25.55/awscli/bcdoc/restdoc.py 2022-08-18 00:52:50.000000000 +0200 +++ new/aws-cli-1.25.60/awscli/bcdoc/restdoc.py 2022-08-24 20:11:30.000000000 +0200 @@ -102,6 +102,11 @@ start, end = self._last_doc_string del self._writes[start:end] + def write_from_file(self, filename): + with open(filename, 'r') as f: + for line in f.readlines(): + self.writeln(line.strip()) + class DocumentStructure(ReSTDocument): def __init__(self, name, section_names=None, target='man', context=None): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/awscli/clidocs.py new/aws-cli-1.25.60/awscli/clidocs.py --- old/aws-cli-1.25.55/awscli/clidocs.py 2022-08-18 00:52:50.000000000 +0200 +++ new/aws-cli-1.25.60/awscli/clidocs.py 2022-08-24 20:11:30.000000000 +0200 @@ -12,6 +12,7 @@ # language governing permissions and limitations under the License. import logging import os +import re from botocore import xform_name from botocore.model import StringShape from botocore.utils import is_json_value_header @@ -22,10 +23,15 @@ from awscli.topictags import TopicTagDB from awscli.utils import ( find_service_and_method_in_event_name, is_document_type, - operation_uses_document_types + operation_uses_document_types, is_streaming_blob_type ) LOG = logging.getLogger(__name__) +EXAMPLES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), + 'examples') +GLOBAL_OPTIONS_FILE = os.path.join(EXAMPLES_DIR, 'global_options.rst') +GLOBAL_OPTIONS_SYNOPSIS_FILE = os.path.join(EXAMPLES_DIR, + 'global_synopsis.rst') class CLIDocumentEventHandler(object): @@ -48,6 +54,8 @@ return 'JSON' if is_document_type(shape): return 'document' + if is_streaming_blob_type(shape): + return 'streaming blob' return default def _map_handlers(self, session, event_class, mapfn): @@ -144,6 +152,8 @@ def doc_synopsis_end(self, help_command, **kwargs): doc = help_command.doc + # Append synopsis for global options. + doc.write_from_file(GLOBAL_OPTIONS_SYNOPSIS_FILE) doc.style.end_codeblock() # Reset the documented arg groups for other sections # that may document args (the detailed docs following @@ -173,12 +183,19 @@ argument.argument_model, argument.cli_type_name))) doc.style.indent() doc.include_doc_string(argument.documentation) + if is_streaming_blob_type(argument.argument_model): + self._add_streaming_blob_note(doc) if hasattr(argument, 'argument_model'): self._document_enums(argument.argument_model, doc) self._document_nested_structure(argument.argument_model, doc) doc.style.dedent() doc.style.new_paragraph() + def doc_global_option(self, help_command, **kwargs): + doc = help_command.doc + doc.style.h2('Global Options') + doc.write_from_file(GLOBAL_OPTIONS_FILE) + def doc_relateditems_start(self, help_command, **kwargs): if help_command.related_items: doc = help_command.doc @@ -264,6 +281,15 @@ doc.style.dedent() doc.style.new_paragraph() + def _add_streaming_blob_note(self, doc): + doc.style.start_note() + msg = ("This argument is of type: streaming blob. " + "Its value must be the path to a file " + "(e.g. ``path/to/file``) and must **not** " + "be prefixed with ``file://`` or ``fileb://``") + doc.writeln(msg) + doc.style.end_note() + class ProviderDocumentEventHandler(CLIDocumentEventHandler): @@ -284,20 +310,10 @@ doc.style.new_paragraph() def doc_options_start(self, help_command, **kwargs): - doc = help_command.doc - doc.style.h2('Options') + pass def doc_option(self, arg_name, help_command, **kwargs): - doc = help_command.doc - argument = help_command.arg_table[arg_name] - doc.writeln('``%s`` (%s)' % (argument.cli_name, - argument.cli_type_name)) - doc.include_doc_string(argument.documentation) - if argument.choices: - doc.style.start_ul() - for choice in argument.choices: - doc.style.li(choice) - doc.style.end_ul() + pass def doc_subitems_start(self, help_command, **kwargs): doc = help_command.doc @@ -335,6 +351,9 @@ def doc_options_end(self, help_command, **kwargs): pass + def doc_global_option(self, help_command, **kwargs): + pass + def doc_description(self, help_command, **kwargs): doc = help_command.doc service_model = help_command.obj @@ -371,17 +390,8 @@ doc.style.h2('Description') doc.include_doc_string(operation_model.documentation) self._add_webapi_crosslink(help_command) - self._add_top_level_args_reference(help_command) self._add_note_for_document_types_if_used(help_command) - def _add_top_level_args_reference(self, help_command): - help_command.doc.writeln('') - help_command.doc.write("See ") - help_command.doc.style.internal_link( - title="'aws help'", - page='/reference/index' - ) - help_command.doc.writeln(' for descriptions of global parameters.') def _add_webapi_crosslink(self, help_command): doc = help_command.doc @@ -579,9 +589,6 @@ for member_name, member_shape in output_shape.members.items(): self._doc_member(doc, member_name, member_shape, stack=[]) - def doc_options_end(self, help_command, **kwargs): - self._add_top_level_args_reference(help_command) - class TopicListerDocumentEventHandler(CLIDocumentEventHandler): DESCRIPTION = ( @@ -716,3 +723,44 @@ def doc_subitems_start(self, help_command, **kwargs): pass + + +class GlobalOptionsDocumenter: + """Documenter used to pre-generate global options docs.""" + + def __init__(self, help_command): + self._help_command = help_command + + def _remove_multilines(self, s): + return re.sub(r'\n+', '\n', s) + + def doc_global_options(self): + help_command = self._help_command + for arg in help_command.arg_table: + argument = help_command.arg_table.get(arg) + help_command.doc.writeln( + f"``{argument.cli_name}`` ({argument.cli_type_name})") + help_command.doc.style.indent() + help_command.doc.style.new_paragraph() + help_command.doc.include_doc_string(argument.documentation) + if argument.choices: + help_command.doc.style.start_ul() + for choice in argument.choices: + help_command.doc.style.li(choice) + help_command.doc.style.end_ul() + help_command.doc.style.dedent() + help_command.doc.style.new_paragraph() + global_options = help_command.doc.getvalue().decode('utf-8') + return self._remove_multilines(global_options) + + def doc_global_synopsis(self): + help_command = self._help_command + for arg in help_command.arg_table: + argument = help_command.arg_table.get(arg) + if argument.cli_type_name == 'boolean': + arg_synopsis = f"[{argument.cli_name}]" + else: + arg_synopsis = f"[{argument.cli_name} <value>]" + help_command.doc.writeln(arg_synopsis) + global_synopsis = help_command.doc.getvalue().decode('utf-8') + return self._remove_multilines(global_synopsis) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/awscli/clidriver.py new/aws-cli-1.25.60/awscli/clidriver.py --- old/aws-cli-1.25.55/awscli/clidriver.py 2022-08-18 00:52:50.000000000 +0200 +++ new/aws-cli-1.25.60/awscli/clidriver.py 2022-08-24 20:11:30.000000000 +0200 @@ -484,7 +484,7 @@ event = 'before-building-argument-table-parser.%s.%s' % \ (self._parent_name, self._name) self._emit(event, argument_table=self.arg_table, args=args, - session=self._session) + session=self._session, parsed_globals=parsed_globals) operation_parser = self._create_operation_parser(self.arg_table) self._add_help(operation_parser) parsed_args, remaining = operation_parser.parse_known_args(args) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/awscli/customizations/commands.py new/aws-cli-1.25.60/awscli/customizations/commands.py --- old/aws-cli-1.25.55/awscli/customizations/commands.py 2022-08-18 00:52:50.000000000 +0200 +++ new/aws-cli-1.25.60/awscli/customizations/commands.py 2022-08-24 20:11:30.000000000 +0200 @@ -134,7 +134,7 @@ event = 'before-building-argument-table-parser.%s' % \ ".".join(self.lineage_names) self._session.emit(event, argument_table=self._arg_table, args=args, - session=self._session) + session=self._session, parsed_globals=parsed_globals) parser = ArgTableArgParser(self.arg_table, self.subcommand_table) parsed_args, remaining = parser.parse_known_args(args) @@ -370,7 +370,6 @@ self.doc.style.h2('Description') self.doc.write(help_command.description) self.doc.style.new_paragraph() - self._add_top_level_args_reference(help_command) def doc_synopsis_start(self, help_command, **kwargs): if not help_command.synopsis: @@ -411,12 +410,16 @@ pass def doc_synopsis_end(self, help_command, **kwargs): - if not help_command.synopsis: + if not help_command.synopsis and not help_command.command_table: super(BasicDocHandler, self).doc_synopsis_end( help_command=help_command, **kwargs) else: self.doc.style.end_codeblock() + def doc_global_option(self, help_command, **kwargs): + if not help_command.command_table: + super().doc_global_option(help_command, **kwargs) + def doc_examples(self, help_command, **kwargs): if help_command.examples: self.doc.style.h2('Examples') @@ -438,6 +441,3 @@ def doc_output(self, help_command, event_name, **kwargs): pass - - def doc_options_end(self, help_command, **kwargs): - self._add_top_level_args_reference(help_command) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/awscli/customizations/overridesslcommonname.py new/aws-cli-1.25.60/awscli/customizations/overridesslcommonname.py --- old/aws-cli-1.25.55/awscli/customizations/overridesslcommonname.py 1970-01-01 01:00:00.000000000 +0100 +++ new/aws-cli-1.25.60/awscli/customizations/overridesslcommonname.py 2022-08-24 20:11:30.000000000 +0200 @@ -0,0 +1,138 @@ +# Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# 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. + + +SSL_COMMON_NAMES = { + "sqs": { + "af-south-1": "af-south-1.queue.amazonaws.com", + "ap-east-1": "ap-east-1.queue.amazonaws.com", + "ap-northeast-1": "ap-northeast-1.queue.amazonaws.com", + "ap-northeast-2": "ap-northeast-2.queue.amazonaws.com", + "ap-northeast-3": "ap-northeast-3.queue.amazonaws.com", + "ap-south-1": "ap-south-1.queue.amazonaws.com", + "ap-southeast-1": "ap-southeast-1.queue.amazonaws.com", + "ap-southeast-2": "ap-southeast-2.queue.amazonaws.com", + "ap-southeast-3": "ap-southeast-3.queue.amazonaws.com", + "ca-central-1": "ca-central-1.queue.amazonaws.com", + "eu-central-1": "eu-central-1.queue.amazonaws.com", + "eu-north-1": "eu-north-1.queue.amazonaws.com", + "eu-south-1": "eu-south-1.queue.amazonaws.com", + "eu-west-1": "eu-west-1.queue.amazonaws.com", + "eu-west-2": "eu-west-2.queue.amazonaws.com", + "eu-west-3": "eu-west-3.queue.amazonaws.com", + "me-south-1": "me-south-1.queue.amazonaws.com", + "sa-east-1": "sa-east-1.queue.amazonaws.com", + "us-east-1": "queue.amazonaws.com", + "us-east-2": "us-east-2.queue.amazonaws.com", + "us-west-1": "us-west-1.queue.amazonaws.com", + "us-west-2": "us-west-2.queue.amazonaws.com", + "cn-north-1": "cn-north-1.queue.amazonaws.com.cn", + "cn-northwest-1": "cn-northwest-1.queue.amazonaws.com.cn", + "us-gov-west-1": "us-gov-west-1.queue.amazonaws.com", + "us-isob-east-1": "us-isob-east-1.queue.sc2s.sgov.gov", + }, + "emr": { + "af-south-1": "af-south-1.elasticmapreduce.amazonaws.com", + "ap-east-1": "ap-east-1.elasticmapreduce.amazonaws.com", + "ap-northeast-1": "ap-northeast-1.elasticmapreduce.amazonaws.com", + "ap-northeast-2": "ap-northeast-2.elasticmapreduce.amazonaws.com", + "ap-northeast-3": "ap-northeast-3.elasticmapreduce.amazonaws.com", + "ap-south-1": "ap-south-1.elasticmapreduce.amazonaws.com", + "ap-southeast-1": "ap-southeast-1.elasticmapreduce.amazonaws.com", + "ap-southeast-2": "ap-southeast-2.elasticmapreduce.amazonaws.com", + "ap-southeast-3": "ap-southeast-3.elasticmapreduce.amazonaws.com", + "ca-central-1": "ca-central-1.elasticmapreduce.amazonaws.com", + "eu-north-1": "eu-north-1.elasticmapreduce.amazonaws.com", + "eu-south-1": "eu-south-1.elasticmapreduce.amazonaws.com", + "eu-west-1": "eu-west-1.elasticmapreduce.amazonaws.com", + "eu-west-2": "eu-west-2.elasticmapreduce.amazonaws.com", + "eu-west-3": "eu-west-3.elasticmapreduce.amazonaws.com", + "me-south-1": "me-south-1.elasticmapreduce.amazonaws.com", + "sa-east-1": "sa-east-1.elasticmapreduce.amazonaws.com", + "us-east-2": "us-east-2.elasticmapreduce.amazonaws.com", + "us-west-1": "us-west-1.elasticmapreduce.amazonaws.com", + "us-west-2": "us-west-2.elasticmapreduce.amazonaws.com", + }, + "rds": { + "us-east-1": "rds.amazonaws.com", + }, + "docdb": { + "us-east-1": "rds.amazonaws.com", + }, + "neptune": { + "us-east-1": "rds.amazonaws.com", + }, + "health": { + "aws-global": "health.us-east-1.amazonaws.com", + "af-south-1": "health.us-east-1.amazonaws.com", + "ap-east-1": "health.us-east-1.amazonaws.com", + "ap-northeast-1": "health.us-east-1.amazonaws.com", + "ap-northeast-2": "health.us-east-1.amazonaws.com", + "ap-northeast-3": "health.us-east-1.amazonaws.com", + "ap-south-1": "health.us-east-1.amazonaws.com", + "ap-southeast-1": "health.us-east-1.amazonaws.com", + "ap-southeast-2": "health.us-east-1.amazonaws.com", + "ap-southeast-3": "health.us-east-1.amazonaws.com", + "ca-central-1": "health.us-east-1.amazonaws.com", + "eu-central-1": "health.us-east-1.amazonaws.com", + "eu-north-1": "health.us-east-1.amazonaws.com", + "eu-south-1": "health.us-east-1.amazonaws.com", + "eu-west-1": "health.us-east-1.amazonaws.com", + "eu-west-2": "health.us-east-1.amazonaws.com", + "eu-west-3": "health.us-east-1.amazonaws.com", + "me-south-1": "health.us-east-1.amazonaws.com", + "sa-east-1": "health.us-east-1.amazonaws.com", + "us-east-1": "health.us-east-1.amazonaws.com", + "us-east-2": "health.us-east-1.amazonaws.com", + "us-west-1": "health.us-east-1.amazonaws.com", + "us-west-2": "health.us-east-1.amazonaws.com", + "cn-north-1": "health.cn-northwest-1.amazonaws.com.cn", + "cn-northwest-1": "health.cn-northwest-1.amazonaws.com.cn", + "aws-cn-global": "health.cn-northwest-1.amazonaws.com.cn", + }, +} + +REGION_TO_PARTITION_OVERRIDE = { + "aws-global": "aws", + "aws-cn-global": "aws-cn", +} + + +def register_override_ssl_common_name(cli): + cli.register_last( + "before-building-argument-table-parser", update_endpoint_url + ) + + +def update_endpoint_url(session, parsed_globals, **kwargs): + service = parsed_globals.command + endpoints = SSL_COMMON_NAMES.get(service) + # only change url if user has not overridden already themselves + if endpoints is not None and parsed_globals.endpoint_url is None: + region = session.get_config_variable("region") + endpoint_url = endpoints.get(region) + if endpoint_url is not None: + parsed_globals.endpoint_url = f"https://{endpoint_url}" + if service == "health": + _override_health_region(region, session, parsed_globals) + + +def _override_health_region(region, session, parsed_globals): + if region in REGION_TO_PARTITION_OVERRIDE: + partition = REGION_TO_PARTITION_OVERRIDE[region] + else: + partition = session.get_partition_for_region(region) + if partition == "aws-cn": + parsed_globals.region = "cn-northwest-1" + else: + parsed_globals.region = "us-east-1" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/awscli/customizations/rds.py new/aws-cli-1.25.60/awscli/customizations/rds.py --- old/aws-cli-1.25.55/awscli/customizations/rds.py 2022-08-18 00:52:50.000000000 +0200 +++ new/aws-cli-1.25.60/awscli/customizations/rds.py 2022-08-24 20:11:30.000000000 +0200 @@ -96,8 +96,10 @@ def _run_main(self, parsed_args, parsed_globals): rds = self._session.create_client( - 'rds', parsed_globals.region, parsed_globals.endpoint_url, - parsed_globals.verify_ssl + 'rds', + region_name=parsed_globals.region, + endpoint_url=parsed_globals.endpoint_url, + verify=parsed_globals.verify_ssl ) token = rds.generate_db_auth_token( DBHostname=parsed_args.hostname, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/awscli/examples/global_options.rst new/aws-cli-1.25.60/awscli/examples/global_options.rst --- old/aws-cli-1.25.55/awscli/examples/global_options.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/aws-cli-1.25.60/awscli/examples/global_options.rst 2022-08-24 20:11:30.000000000 +0200 @@ -0,0 +1,72 @@ +``--debug`` (boolean) + + Turn on debug logging. + +``--endpoint-url`` (string) + + Override command's default URL with the given URL. + +``--no-verify-ssl`` (boolean) + + By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates. + +``--no-paginate`` (boolean) + + Disable automatic pagination. + +``--output`` (string) + + The formatting style for command output. + + + * json + + * text + + * table + + +``--query`` (string) + + A JMESPath query to use in filtering the response data. + +``--profile`` (string) + + Use a specific profile from your credential file. + +``--region`` (string) + + The region to use. Overrides config/env settings. + +``--version`` (string) + + Display the version of this tool. + +``--color`` (string) + + Turn on/off color output. + + + * on + + * off + + * auto + + +``--no-sign-request`` (boolean) + + Do not sign requests. Credentials will not be loaded if this argument is provided. + +``--ca-bundle`` (string) + + The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings. + +``--cli-read-timeout`` (int) + + The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds. + +``--cli-connect-timeout`` (int) + + The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds. + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/awscli/examples/global_synopsis.rst new/aws-cli-1.25.60/awscli/examples/global_synopsis.rst --- old/aws-cli-1.25.55/awscli/examples/global_synopsis.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/aws-cli-1.25.60/awscli/examples/global_synopsis.rst 2022-08-24 20:11:30.000000000 +0200 @@ -0,0 +1,14 @@ +[--debug] +[--endpoint-url <value>] +[--no-verify-ssl] +[--no-paginate] +[--output <value>] +[--query <value>] +[--profile <value>] +[--region <value>] +[--version <value>] +[--color <value>] +[--no-sign-request] +[--ca-bundle <value>] +[--cli-read-timeout <value>] +[--cli-connect-timeout <value>] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/awscli/handlers.py new/aws-cli-1.25.60/awscli/handlers.py --- old/aws-cli-1.25.55/awscli/handlers.py 2022-08-18 00:52:50.000000000 +0200 +++ new/aws-cli-1.25.60/awscli/handlers.py 2022-08-24 20:11:30.000000000 +0200 @@ -91,6 +91,7 @@ from awscli.customizations.sessionmanager import register_ssm_session from awscli.customizations.sms_voice import register_sms_voice_hide from awscli.customizations.dynamodb import register_dynamodb_paginator_fix +from awscli.customizations.overridesslcommonname import register_override_ssl_common_name def awscli_initialize(event_handlers): @@ -183,3 +184,4 @@ register_ssm_session(event_handlers) register_sms_voice_hide(event_handlers) register_dynamodb_paginator_fix(event_handlers) + register_override_ssl_common_name(event_handlers) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/awscli/utils.py new/aws-cli-1.25.60/awscli/utils.py --- old/aws-cli-1.25.55/awscli/utils.py 2022-08-18 00:52:50.000000000 +0200 +++ new/aws-cli-1.25.60/awscli/utils.py 2022-08-24 20:11:30.000000000 +0200 @@ -153,6 +153,12 @@ return True +def is_streaming_blob_type(shape): + """Check if the shape is a streaming blob type.""" + return (shape and shape.type_name == 'blob' and + shape.serialization.get('streaming', False)) + + def operation_uses_document_types(operation_model): """Check if document types are ever used in the operation""" recording_visitor = ShapeRecordingVisitor() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/doc/source/conf.py new/aws-cli-1.25.60/doc/source/conf.py --- old/aws-cli-1.25.55/doc/source/conf.py 2022-08-18 00:52:50.000000000 +0200 +++ new/aws-cli-1.25.60/doc/source/conf.py 2022-08-24 20:11:30.000000000 +0200 @@ -52,7 +52,7 @@ # The short X.Y version. version = '1.25.' # The full version, including alpha/beta/rc tags. -release = '1.25.55' +release = '1.25.60' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/scripts/ci/run-integ-tests new/aws-cli-1.25.60/scripts/ci/run-integ-tests --- old/aws-cli-1.25.55/scripts/ci/run-integ-tests 2022-08-18 00:52:50.000000000 +0200 +++ new/aws-cli-1.25.60/scripts/ci/run-integ-tests 2022-08-24 20:11:30.000000000 +0200 @@ -24,7 +24,9 @@ def run(command): - return check_call(command, shell=True) + env = os.environ.copy() + env['TESTS_REMOVE_REPO_ROOT_FROM_PATH'] = 'true' + return check_call(command, shell=True, env=env) if __name__ == "__main__": diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/scripts/ci/run-tests new/aws-cli-1.25.60/scripts/ci/run-tests --- old/aws-cli-1.25.55/scripts/ci/run-tests 2022-08-18 00:52:50.000000000 +0200 +++ new/aws-cli-1.25.60/scripts/ci/run-tests 2022-08-24 20:11:30.000000000 +0200 @@ -26,7 +26,9 @@ def run(command): - return check_call(command, shell=True) + env = os.environ.copy() + env['TESTS_REMOVE_REPO_ROOT_FROM_PATH'] = 'true' + return check_call(command, shell=True, env=env) def process_args(args): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/scripts/make-global-opts-documentation new/aws-cli-1.25.60/scripts/make-global-opts-documentation --- old/aws-cli-1.25.55/scripts/make-global-opts-documentation 1970-01-01 01:00:00.000000000 +0100 +++ new/aws-cli-1.25.60/scripts/make-global-opts-documentation 2022-08-24 20:11:30.000000000 +0200 @@ -0,0 +1,38 @@ +#!/usr/bin/env python +"""Generate a global options section. + +The purpose of this script is to pre-generate +global options for the help docs. +The output of this script is loaded and applied to +every subcommand's help docs. + +""" + +import os + +from awscli.clidriver import create_clidriver +from awscli.clidocs import ( + EXAMPLES_DIR, GLOBAL_OPTIONS_FILE, + GLOBAL_OPTIONS_SYNOPSIS_FILE, GlobalOptionsDocumenter +) + + +def main(): + if not os.path.isdir(EXAMPLES_DIR): + os.makedirs(EXAMPLES_DIR) + driver = create_clidriver() + options_help_command = driver.create_help_command() + synopsis_help_command = driver.create_help_command() + options_documenter = GlobalOptionsDocumenter(options_help_command) + synopsis_documenter = GlobalOptionsDocumenter(synopsis_help_command) + + with open(GLOBAL_OPTIONS_FILE, 'w') as f: + for line in options_documenter.doc_global_options(): + f.write(line) + with open(GLOBAL_OPTIONS_SYNOPSIS_FILE, 'w') as f: + for line in synopsis_documenter.doc_global_synopsis(): + f.write(line) + + +if __name__ == "__main__": + main() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/setup.cfg new/aws-cli-1.25.60/setup.cfg --- old/aws-cli-1.25.55/setup.cfg 2022-08-18 00:52:50.000000000 +0200 +++ new/aws-cli-1.25.60/setup.cfg 2022-08-24 20:11:30.000000000 +0200 @@ -3,7 +3,7 @@ [metadata] requires_dist = - botocore==1.27.54 + botocore==1.27.59 docutils>=0.10,<0.17 s3transfer>=0.6.0,<0.7.0 PyYAML>=3.10,<5.5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/setup.py new/aws-cli-1.25.60/setup.py --- old/aws-cli-1.25.55/setup.py 2022-08-18 00:52:50.000000000 +0200 +++ new/aws-cli-1.25.60/setup.py 2022-08-24 20:11:30.000000000 +0200 @@ -24,7 +24,7 @@ install_requires = [ - 'botocore==1.27.54', + 'botocore==1.27.59', 'docutils>=0.10,<0.17', 's3transfer>=0.6.0,<0.7.0', 'PyYAML>=3.10,<5.5', @@ -44,10 +44,10 @@ 'bin/aws_completer', 'bin/aws_zsh_completer.sh', 'bin/aws_bash_completer'], packages=find_packages(exclude=['tests*']), - package_data={'awscli': ['data/*.json', 'examples/*/*.rst', - 'examples/*/*.txt', 'examples/*/*/*.txt', - 'examples/*/*/*.rst', 'topics/*.rst', - 'topics/*.json']}, + package_data={'awscli': ['data/*.json', 'examples/*.rst', + 'examples/*/*.rst', 'examples/*/*.txt', + 'examples/*/*/*.txt', 'examples/*/*/*.rst', + 'topics/*.rst', 'topics/*.json']}, install_requires=install_requires, extras_require={}, license="Apache License 2.0", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/tests/__init__.py new/aws-cli-1.25.60/tests/__init__.py --- old/aws-cli-1.25.55/tests/__init__.py 2022-08-18 00:52:50.000000000 +0200 +++ new/aws-cli-1.25.60/tests/__init__.py 2022-08-24 20:11:30.000000000 +0200 @@ -1,6 +1,21 @@ import collections import copy import os +import sys + +# Both nose and py.test will add the first parent directory it +# encounters that does not have a __init__.py to the sys.path. In +# our case, this is the root of the repository. This means that Python +# will import the awscli package from source instead of any installed +# distribution. This environment variable provides the option to remove the +# repository root from sys.path to be able to rely on the installed +# distribution when running the tests. +if os.environ.get('TESTS_REMOVE_REPO_ROOT_FROM_PATH'): + rootdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + sys.path = [ + path for path in sys.path + if not os.path.isdir(path) or not os.path.samefile(path, rootdir) + ] import awscli from awscli.clidriver import create_clidriver diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/tests/functional/docs/test_help_output.py new/aws-cli-1.25.60/tests/functional/docs/test_help_output.py --- old/aws-cli-1.25.55/tests/functional/docs/test_help_output.py 2022-08-18 00:52:50.000000000 +0200 +++ new/aws-cli-1.25.60/tests/functional/docs/test_help_output.py 2022-08-24 20:11:30.000000000 +0200 @@ -46,9 +46,9 @@ self.assert_contains('``--no-paginate``') # Arg with choices self.assert_contains('``--color``') - self.assert_contains('* on') - self.assert_contains('* off') - self.assert_contains('* auto') + self.assert_contains('* on') + self.assert_contains('* off') + self.assert_contains('* auto') # Then we should see the services. self.assert_contains('* ec2') self.assert_contains('* s3api') @@ -80,22 +80,23 @@ self.assert_contains('Launches the specified number of instances') self.assert_contains('``--count`` (string)') - def test_waiter_does_not_have_duplicate_global_params_link(self): - self.driver.main(['ec2', 'wait', 'help']) - self.assert_contains_with_count( - 'for descriptions of global parameters', 1) - def test_custom_service_help_output(self): self.driver.main(['s3', 'help']) self.assert_contains('.. _cli:aws s3:') self.assert_contains('high-level S3 commands') self.assert_contains('* cp') + def test_waiter_does_not_have_global_args(self): + self.driver.main(['ec2', 'wait', 'help']) + self.assert_not_contains('--debug') + self.assert_not_contains('Global Options') + def test_custom_operation_help_output(self): self.driver.main(['s3', 'ls', 'help']) self.assert_contains('.. _cli:aws s3 ls:') self.assert_contains('List S3 objects') self.assert_contains('--summarize') + self.assert_contains('--debug') def test_topic_list_help_output(self): self.driver.main(['help', 'topics']) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/tests/functional/test_globals.py new/aws-cli-1.25.60/tests/functional/test_globals.py --- old/aws-cli-1.25.55/tests/functional/test_globals.py 1970-01-01 01:00:00.000000000 +0100 +++ new/aws-cli-1.25.60/tests/functional/test_globals.py 2022-08-24 20:11:30.000000000 +0200 @@ -0,0 +1,23 @@ +import os +import unittest + +from awscli.testutils import create_clidriver +from awscli.clidocs import ( + GLOBAL_OPTIONS_FILE, GLOBAL_OPTIONS_SYNOPSIS_FILE, + GlobalOptionsDocumenter +) + + +class TestGlobalOptionsDocumenter(unittest.TestCase): + def setUp(self): + self.driver = create_clidriver() + self.help_command = self.driver.create_help_command() + self.globals = GlobalOptionsDocumenter(self.help_command) + + def test_doc_global_options_match_saved_content(self): + with open(GLOBAL_OPTIONS_FILE, 'r') as f: + self.assertEqual(self.globals.doc_global_options(), f.read()) + + def test_doc_global_synopsis_match_saved_content(self): + with open(GLOBAL_OPTIONS_SYNOPSIS_FILE, 'r') as f: + self.assertEqual(self.globals.doc_global_synopsis(), f.read()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/tests/functional/test_override_ssl_common_name.py new/aws-cli-1.25.60/tests/functional/test_override_ssl_common_name.py --- old/aws-cli-1.25.55/tests/functional/test_override_ssl_common_name.py 1970-01-01 01:00:00.000000000 +0100 +++ new/aws-cli-1.25.60/tests/functional/test_override_ssl_common_name.py 2022-08-24 20:11:30.000000000 +0200 @@ -0,0 +1,64 @@ +# Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# 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. + +from awscli.testutils import BaseAWSCommandParamsTest +from awscli.customizations.overridesslcommonname import SSL_COMMON_NAMES + + +class OverrideSSLCommonNameTestCase(BaseAWSCommandParamsTest): + def _common_name_test_cases(self): + + service_ops = { + "sqs": "list-queues", + "emr": "list-clusters", + "rds": "describe-db-clusters", + "neptune": "describe-db-clusters", + "docdb": "describe-db-clusters", + } + for service, operation in service_ops.items(): + for region in SSL_COMMON_NAMES[service]: + yield (service, operation, region) + + def _assert_region_endpoint_used( + self, expected_region, expected_endpoint_url + ): + self.assertEqual( + expected_region, self.last_request_dict["context"]["client_region"] + ) + self.assertEqual( + expected_endpoint_url, + self.last_request_dict["url"], + ) + + def test_set_endpoint_url_arg(self): + for service, operation, region in self._common_name_test_cases(): + self.run_cmd(f"{service} {operation} --region {region}".split()) + expected_endpoint_url = ( + f"https://{SSL_COMMON_NAMES[service][region]}/" + ) + self._assert_region_endpoint_used(region, expected_endpoint_url) + + def test_override_health_endpoint_and_region(self): + expected_override_region = "us-east-1" + health_regions = SSL_COMMON_NAMES["health"] + for region in health_regions: + if region in ["cn-north-1", "cn-northwest-1", "aws-cn-global"]: + expected_override_region = "cn-northwest-1" + expected_endpoint_url = ( + f"https://{SSL_COMMON_NAMES['health'][region]}/" + ) + self.run_cmd(f"health describe-events --region {region}".split()) + self._assert_region_endpoint_used( + expected_override_region, + expected_endpoint_url, + ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/tests/unit/customizations/test_commands.py new/aws-cli-1.25.60/tests/unit/customizations/test_commands.py --- old/aws-cli-1.25.55/tests/unit/customizations/test_commands.py 2022-08-18 00:52:50.000000000 +0200 +++ new/aws-cli-1.25.60/tests/unit/customizations/test_commands.py 2022-08-24 20:11:30.000000000 +0200 @@ -15,7 +15,6 @@ from awscli.clidriver import CLIDriver from awscli.customizations.commands import BasicHelp, BasicCommand from awscli.customizations.commands import BasicDocHandler -from awscli.bcdoc.restdoc import ReSTDocument from botocore.hooks import HierarchicalEmitter from tests.unit.test_clidriver import FakeSession, FakeCommand @@ -144,45 +143,57 @@ self.session, self.obj, self.command_table, self.arg_table ) - def test_includes_global_args_ref_in_man_description(self): - help_command = self.create_help_command() + def create_arg_table(self): + return CLIDriver().create_help_command().arg_table + + def generate_global_option_docs(self, help_command): operation_handler = BasicDocHandler(help_command) - operation_handler.doc_description(help_command=help_command) - rendered = help_command.doc.getvalue() - rendered = rendered.decode('utf-8') - # The links aren't generated in the "man" mode. - self.assertIn( - "See 'aws help' for descriptions of global parameters", rendered - ) + operation_handler.doc_global_option(help_command=help_command) + return help_command.doc.getvalue().decode('utf-8') - def test_includes_global_args_ref_in_html_description(self): - help_command = self.create_help_command() - help_command.doc.target = 'html' + def generate_global_synopsis_docs(self, help_command): operation_handler = BasicDocHandler(help_command) - operation_handler.doc_description(help_command=help_command) - rendered = help_command.doc.getvalue().decode('utf-8') - self.assertIn( - "See :doc:`'aws help' </reference/index>` for descriptions of " - "global parameters", rendered - ) + operation_handler.doc_synopsis_end(help_command=help_command) + return help_command.doc.getvalue().decode('utf-8') + + def assert_global_args_documented(self, arg_table, content): + for arg in arg_table: + self.assertIn(arg_table.get(arg).cli_name, content) + + def assert_global_args_not_documented(self, arg_table, content): + for arg in arg_table: + self.assertNotIn(arg_table.get(arg).cli_name, content) - def test_includes_global_args_ref_in_man_options(self): + def test_includes_global_options_when_command_table_empty(self): help_command = self.create_help_command() - operation_handler = BasicDocHandler(help_command) - operation_handler.doc_options_end(help_command=help_command) - rendered = help_command.doc.getvalue().decode('utf-8') - # The links aren't generated in the "man" mode. - self.assertIn( - "See 'aws help' for descriptions of global parameters", rendered - ) + arg_table = self.create_arg_table() + help_command.arg_table = arg_table + rendered = self.generate_global_option_docs(help_command) + self.assert_global_args_documented(arg_table, rendered) - def test_includes_global_args_ref_in_html_options(self): + def test_excludes_global_options_when_command_table_not_empty(self): help_command = self.create_help_command() - help_command.doc.target = 'html' - operation_handler = BasicDocHandler(help_command) - operation_handler.doc_options_end(help_command=help_command) - rendered = help_command.doc.getvalue().decode('utf-8') - self.assertIn( - "See :doc:`'aws help' </reference/index>` for descriptions of " - "global parameters", rendered - ) + arg_table = self.create_arg_table() + help_command.arg_table = arg_table + fake_command = FakeCommand(FakeSession()) + fake_command.NAME = 'command' + help_command.command_table = {'command': fake_command} + rendered = self.generate_global_option_docs(help_command) + self.assert_global_args_not_documented(arg_table, rendered) + + def test_includes_global_synopsis_when_command_table_empty(self): + help_command = self.create_help_command() + arg_table = self.create_arg_table() + help_command.arg_table = arg_table + rendered = self.generate_global_synopsis_docs(help_command) + self.assert_global_args_documented(arg_table, rendered) + + def test_excludes_global_synopsis_when_command_table_not_empty(self): + help_command = self.create_help_command() + arg_table = self.create_arg_table() + help_command.arg_table = arg_table + fake_command = FakeCommand(FakeSession()) + fake_command.NAME = 'command' + help_command.command_table = {'command': fake_command} + rendered = self.generate_global_synopsis_docs(help_command) + self.assert_global_args_not_documented(arg_table, rendered) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/tests/unit/customizations/test_overridesslcommonname.py new/aws-cli-1.25.60/tests/unit/customizations/test_overridesslcommonname.py --- old/aws-cli-1.25.55/tests/unit/customizations/test_overridesslcommonname.py 1970-01-01 01:00:00.000000000 +0100 +++ new/aws-cli-1.25.60/tests/unit/customizations/test_overridesslcommonname.py 2022-08-24 20:11:30.000000000 +0200 @@ -0,0 +1,75 @@ +# Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# 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. + +from awscli.testutils import create_clidriver +from awscli.customizations.overridesslcommonname import ( + update_endpoint_url, + SSL_COMMON_NAMES, +) + +import pytest +import argparse + + +def parameters(): + for service, regions in SSL_COMMON_NAMES.items(): + for region in regions: + yield (service, region) + + +@pytest.fixture +def parsed_globals(): + pg = argparse.Namespace() + pg.endpoint_url = None + pg.region = None + return pg + + +@pytest.fixture +def session(): + driver = create_clidriver() + return driver.session + + +@pytest.mark.parametrize("service,region", parameters()) +def test_update_endpoint_url(parsed_globals, session, service, region): + parsed_globals.command = service + session.set_config_variable("region", region) + update_endpoint_url(session, parsed_globals) + assert parsed_globals.endpoint_url == ( + f"https://{SSL_COMMON_NAMES[service][region]}" + ) + + +@pytest.mark.parametrize("service,region", parameters()) +def test_url_modified_from_event(parsed_globals, session, service, region): + assert parsed_globals.endpoint_url is None + parsed_globals.command = service + session.set_config_variable("region", region) + session.emit( + f"before-building-argument-table-parser.{service}", + args=[], + session=session, + argument_table={}, + parsed_globals=parsed_globals, + ) + assert parsed_globals.endpoint_url == ( + f"https://{SSL_COMMON_NAMES[service][region]}" + ) + + +def test_dont_modify_provided_url(parsed_globals, session): + parsed_globals.endpoint_url = "http://test.com" + parsed_globals.command = "sqs" + update_endpoint_url(session, parsed_globals) + assert parsed_globals.endpoint_url == "http://test.com" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/tests/unit/test_clidocs.py new/aws-cli-1.25.60/tests/unit/test_clidocs.py --- old/aws-cli-1.25.55/tests/unit/test_clidocs.py 2022-08-18 00:52:50.000000000 +0200 +++ new/aws-cli-1.25.60/tests/unit/test_clidocs.py 2022-08-24 20:11:30.000000000 +0200 @@ -13,15 +13,16 @@ import json from botocore.model import ShapeResolver, StructureShape, StringShape, \ - ListShape, MapShape + ListShape, MapShape, Shape from awscli.testutils import mock, unittest, FileCreator from awscli.clidocs import OperationDocumentEventHandler, \ CLIDocumentEventHandler, TopicListerDocumentEventHandler, \ - TopicDocumentEventHandler + TopicDocumentEventHandler, GlobalOptionsDocumenter from awscli.bcdoc.restdoc import ReSTDocument from awscli.help import ServiceHelpCommand, TopicListerCommand, \ - TopicHelpCommand + TopicHelpCommand, HelpCommand +from awscli.arguments import CustomArgument class TestRecursiveShapes(unittest.TestCase): @@ -364,47 +365,31 @@ '<https://docs.aws.amazon.com/goto/' 'WebAPI/service-1-2-3/myoperation>`_', rendered) - def test_includes_global_args_ref_in_man_description(self): + def test_includes_streaming_blob_options(self): help_command = self.create_help_command() + blob_shape = Shape('blob_shape', {'type': 'blob'}) + blob_shape.serialization = {'streaming': True} + blob_arg = CustomArgument('blob_arg', argument_model=blob_shape) + help_command.arg_table = {'blob_arg': blob_arg} operation_handler = OperationDocumentEventHandler(help_command) - operation_handler.doc_description(help_command=help_command) - rendered = help_command.doc.getvalue().decode('utf-8') - # The links aren't generated in the "man" mode. - self.assertIn( - "See 'aws help' for descriptions of global parameters", rendered - ) - - def test_includes_global_args_ref_in_html_description(self): - help_command = self.create_help_command() - help_command.doc.target = 'html' - operation_handler = OperationDocumentEventHandler(help_command) - operation_handler.doc_description(help_command=help_command) - rendered = help_command.doc.getvalue().decode('utf-8') - self.assertIn( - "See :doc:`'aws help' </reference/index>` for descriptions of " - "global parameters", rendered - ) - - def test_includes_global_args_ref_in_man_options(self): - help_command = self.create_help_command() - operation_handler = OperationDocumentEventHandler(help_command) - operation_handler.doc_options_end(help_command=help_command) + operation_handler.doc_option(arg_name='blob_arg', + help_command=help_command) rendered = help_command.doc.getvalue().decode('utf-8') - # The links aren't generated in the "man" mode. - self.assertIn( - "See 'aws help' for descriptions of global parameters", rendered - ) + self.assertIn('streaming blob', rendered) - def test_includes_global_args_ref_in_html_options(self): + def test_streaming_blob_comes_after_docstring(self): help_command = self.create_help_command() - help_command.doc.target = 'html' + blob_shape = Shape('blob_shape', {'type': 'blob'}) + blob_shape.serialization = {'streaming': True} + blob_arg = CustomArgument(name='blob_arg', + argument_model=blob_shape, + help_text='FooBar') + help_command.arg_table = {'blob_arg': blob_arg} operation_handler = OperationDocumentEventHandler(help_command) - operation_handler.doc_options_end(help_command=help_command) + operation_handler.doc_option(arg_name='blob_arg', + help_command=help_command) rendered = help_command.doc.getvalue().decode('utf-8') - self.assertIn( - "See :doc:`'aws help' </reference/index>` for descriptions of " - "global parameters", rendered - ) + self.assertRegex(rendered, r'FooBar[\s\S]*streaming blob') class TestTopicDocumentEventHandlerBase(unittest.TestCase): @@ -613,3 +598,43 @@ self.doc_handler.doc_description(self.cmd) contents = self.cmd.doc.getvalue().decode('utf-8') self.assertIn(ref_body, contents) + + +class TestGlobalOptionsDocumenter(unittest.TestCase): + def create_help_command(self): + types = ['blob', 'integer', 'boolean', 'string'] + arg_table = {} + for t in types: + name = f'{t}_type' + help_text = f'This arg type is {t}' + choices = ['A', 'B', 'C'] if t == 'string' else [] + arg_table[name] = CustomArgument(name=name, + cli_type_name=t, + help_text=help_text, + choices=choices) + help_command = mock.Mock(spec=HelpCommand) + help_command.arg_table = arg_table + help_command.doc = ReSTDocument() + return help_command + + def create_documenter(self): + return GlobalOptionsDocumenter(self.create_help_command()) + + def test_doc_global_options(self): + documenter = self.create_documenter() + options = documenter.doc_global_options() + self.assertIn('``--string_type`` (string)', options) + self.assertIn('``--integer_type`` (integer)', options) + self.assertIn('``--boolean_type`` (boolean)', options) + self.assertIn('``--blob_type`` (blob)', options) + self.assertIn('* A', options) + self.assertIn('* B', options) + self.assertIn('* C', options) + + def test_doc_global_synopsis(self): + documenter = self.create_documenter() + synopsis = documenter.doc_global_synopsis() + self.assertIn('[--string_type <value>]', synopsis) + self.assertIn('[--integer_type <value>]', synopsis) + self.assertIn('[--boolean_type]', synopsis) + self.assertIn('[--blob_type <value>]', synopsis) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-cli-1.25.55/tests/unit/test_utils.py new/aws-cli-1.25.60/tests/unit/test_utils.py --- old/aws-cli-1.25.55/tests/unit/test_utils.py 2022-08-18 00:52:50.000000000 +0200 +++ new/aws-cli-1.25.60/tests/unit/test_utils.py 2022-08-24 20:11:30.000000000 +0200 @@ -12,6 +12,7 @@ # language governing permissions and limitations under the License. import signal import platform +import pytest import subprocess import os @@ -20,12 +21,17 @@ from awscli.testutils import unittest, skip_if_windows, mock from awscli.utils import ( split_on_commas, ignore_ctrl_c, find_service_and_method_in_event_name, - is_document_type, is_document_type_container, + is_document_type, is_document_type_container, is_streaming_blob_type, operation_uses_document_types, ShapeWalker, ShapeRecordingVisitor, OutputStreamFactory ) +@pytest.fixture() +def argument_model(): + return botocore.model.Shape('argument', {'type': 'string'}) + + class TestCSVSplit(unittest.TestCase): def test_normal_csv_split(self): @@ -409,3 +415,21 @@ } self.walker.walk(self.get_shape_model('Recursive'), self.visitor) self.assert_visited_shapes(['Recursive']) + + +@pytest.mark.usefixtures('argument_model') +class TestStreamingBlob: + def test_blob_is_streaming(self, argument_model): + argument_model.type_name = 'blob' + argument_model.serialization = {'streaming': True} + assert is_streaming_blob_type(argument_model) + + def test_blob_is_not_streaming(self, argument_model): + argument_model.type_name = 'blob' + argument_model.serialization = {} + assert not is_streaming_blob_type(argument_model) + + def test_non_blob_is_not_streaming(self, argument_model): + argument_model.type_name = 'string' + argument_model.serialization = {} + assert not is_streaming_blob_type(argument_model)
participants (1)
-
Source-Sync