@@ -66,8 +66,7 @@ class CLIDriver(object):
6666 'jsondoc' : str ,
6767 'file' : str }
6868
69- def __init__ (self , provider_name = 'aws' ):
70- self .provider_name = provider_name
69+ def __init__ (self ):
7170 self .session = botocore .session .get_session (EnvironmentVariables )
7271 self .session .user_agent_name = 'aws-cli'
7372 self .session .user_agent_version = __version__
@@ -98,7 +97,9 @@ def create_main_parser(self):
9897 if 'choices' in option_data :
9998 choices = option_data ['choices' ]
10099 if not isinstance (choices , list ):
101- choices = self .session .get_data (option_data ['choices' ])
100+ provider = self .session .get_variable ('provider' )
101+ choices_path = choices .format (provider = provider )
102+ choices = self .session .get_data (choices_path )
102103 if isinstance (choices , dict ):
103104 choices = list (choices .keys ())
104105 option_data ['help' ] = self .create_choice_help (choices )
@@ -281,17 +282,11 @@ def get_error_code_and_message(self, response):
281282
282283 def call (self , args ):
283284 try :
284- if self .args .region is not None :
285- self .region = self .args .region
286- elif self .session .get_config ():
287- self .region = self .session .get_config ().get ('region' , None )
288- if self .region is None :
289- msg = self .session .get_data ('messages/NoRegionError' )
290- raise ValueError (msg )
291285 params = {}
292286 self .build_call_parameters (args , params )
293- self .endpoint = self .service .get_endpoint (self .region ,
287+ self .endpoint = self .service .get_endpoint (self .args . region ,
294288 endpoint_url = self .args .endpoint_url )
289+ self .endpoint .verify = not self .args .no_verify_ssl
295290 http_response , response_data = self .operation .call (self .endpoint ,
296291 ** params )
297292 self .formatter (self .operation , response_data )
@@ -336,7 +331,8 @@ def main(self):
336331 self .create_main_parser ()
337332 self .args , remaining = self .parser .parse_known_args ()
338333 if self .args .service_name == 'help' :
339- get_help (self .session , provider = 'aws' , style = 'cli' )
334+ provider = self .session .get_variable ('provider' )
335+ get_help (self .session , provider = provider , style = 'cli' )
340336 sys .exit (0 )
341337 else :
342338 if self .args .debug :
0 commit comments