4848 ServiceHelpCommand ,
4949)
5050from awscli .plugin import load_plugins
51- from awscli .utils import emit_top_level_args_parsed_event , write_exception , create_nested_client , resolve_v2_debug_mode
51+ from awscli .utils import emit_top_level_args_parsed_event , write_exception , create_nested_client
5252from botocore import __version__ as botocore_version
5353from botocore import xform_name
5454
@@ -225,7 +225,7 @@ def main(self, args=None):
225225 # that exceptions can be raised, which should have the same
226226 # general exception handling logic as calling into the
227227 # command table. This is why it's in the try/except clause.
228- self ._handle_top_level_args (parsed_args , remaining )
228+ self ._handle_top_level_args (parsed_args )
229229 self ._emit_session_event (parsed_args )
230230 HISTORY_RECORDER .record (
231231 'CLI_VERSION' , self .session .user_agent (), 'CLI'
@@ -279,8 +279,8 @@ def _show_error(self, msg):
279279 sys .stderr .write (msg )
280280 sys .stderr .write ('\n ' )
281281
282- def _handle_top_level_args (self , args , remaining ):
283- emit_top_level_args_parsed_event (self .session , args , remaining )
282+ def _handle_top_level_args (self , args ):
283+ emit_top_level_args_parsed_event (self .session , args )
284284 if args .profile :
285285 self .session .set_config_variable ('profile' , args .profile )
286286 if args .region :
@@ -542,15 +542,9 @@ def __call__(self, args, parsed_globals):
542542 event , parsed_args = parsed_args , parsed_globals = parsed_globals
543543 )
544544 call_parameters = self ._build_call_parameters (
545- parsed_args , self .arg_table , parsed_globals
545+ parsed_args , self .arg_table
546546 )
547547
548- self ._detect_binary_file_migration_change (
549- self ._session ,
550- parsed_args ,
551- parsed_globals ,
552- self .arg_table
553- )
554548 event = f'calling-command.{ self ._parent_name } .{ self ._name } '
555549 override = self ._emit_first_non_none_response (
556550 event ,
@@ -596,7 +590,7 @@ def _add_help(self, parser):
596590 # CLIArguments for values.
597591 parser .add_argument ('help' , nargs = '?' )
598592
599- def _build_call_parameters (self , args , arg_table , parsed_globals ):
593+ def _build_call_parameters (self , args , arg_table ):
600594 # We need to convert the args specified on the command
601595 # line as valid **kwargs we can hand to botocore.
602596 service_params = {}
@@ -607,19 +601,19 @@ def _build_call_parameters(self, args, arg_table, parsed_globals):
607601 py_name = arg_object .py_name
608602 if py_name in parsed_args :
609603 value = parsed_args [py_name ]
610- value = self ._unpack_arg (arg_object , value , parsed_globals )
604+ value = self ._unpack_arg (arg_object , value )
611605 arg_object .add_to_params (service_params , value )
612606 return service_params
613607
614- def _unpack_arg (self , cli_argument , value , parsed_globals ):
608+ def _unpack_arg (self , cli_argument , value ):
615609 # Unpacks a commandline argument into a Python value by firing the
616610 # load-cli-arg.service-name.operation-name event.
617611 session = self ._session
618612 service_name = self ._operation_model .service_model .endpoint_prefix
619613 operation_name = xform_name (self ._name , '-' )
620614
621615 return unpack_argument (
622- session , service_name , operation_name , cli_argument , value , parsed_globals
616+ session , service_name , operation_name , cli_argument , value
623617 )
624618
625619 def _create_argument_table (self ):
@@ -667,46 +661,6 @@ def _create_operation_parser(self, arg_table):
667661 parser = ArgTableArgParser (arg_table )
668662 return parser
669663
670- def _detect_binary_file_migration_change (
671- self ,
672- session ,
673- parsed_args ,
674- parsed_globals ,
675- arg_table
676- ):
677- if (
678- session .get_scoped_config ()
679- .get ('cli_binary_format' , None ) == 'raw-in-base64-out'
680- ):
681- # if cli_binary_format is set to raw-in-base64-out, then v2 behavior will
682- # be the same as v1, so there is no breaking change in this case.
683- return
684- if resolve_v2_debug_mode (parsed_globals ):
685- parsed_args_to_check = {
686- arg : getattr (parsed_args , arg )
687- for arg in vars (parsed_args ) if getattr (parsed_args , arg )
688- }
689-
690- arg_values_to_check = [
691- arg .py_name for arg in arg_table .values ()
692- if arg .py_name in parsed_args_to_check
693- and arg .argument_model .type_name == 'blob'
694- ]
695- if arg_values_to_check :
696- print (
697- '\n AWS CLI v2 UPGRADE WARNING: When specifying a '
698- 'blob-type parameter, AWS CLI v2 will assume the '
699- 'parameter value is base64-encoded. This is different '
700- 'from v1 behavior, where the AWS CLI will automatically '
701- 'encode the value to base64. To retain v1 behavior in '
702- 'AWS CLI v2, set the `cli_binary_format` configuration '
703- 'variable to `raw-in-base64-out`. See '
704- 'https://docs.aws.amazon.com/cli/latest/userguide/'
705- 'cliv2-migration-changes.html'
706- '#cliv2-migration-binaryparam.\n ' ,
707- file = sys .stderr
708- )
709-
710664
711665class CLIOperationCaller :
712666 """Call an AWS operation and format the response."""
0 commit comments