MCPcopy Index your code
hub / github.com/aws/aws-cli / get_scoped_config

Method get_scoped_config

awscli/botocore/session.py:346–381  ·  view source on GitHub ↗

Returns the config values from the config file scoped to the current profile. The configuration data is loaded **only** from the config file. It does not resolve variables based on different locations (e.g. first from the session instance, then from environm

(self)

Source from the content-addressed store, hash-verified

344 return copy.copy(self._session_instance_vars)
345
346 def get_scoped_config(self):
347 """
348 Returns the config values from the config file scoped to the current
349 profile.
350
351 The configuration data is loaded **only** from the config file.
352 It does not resolve variables based on different locations
353 (e.g. first from the session instance, then from environment
354 variables, then from the config file). If you want this lookup
355 behavior, use the ``get_config_variable`` method instead.
356
357 Note that this configuration is specific to a single profile (the
358 ``profile`` session variable).
359
360 If the ``profile`` session variable is set and the profile does
361 not exist in the config file, a ``ProfileNotFound`` exception
362 will be raised.
363
364 :raises: ConfigNotFound, ConfigParseError, ProfileNotFound
365 :rtype: dict
366
367 """
368 profile_name = self.get_config_variable('profile')
369 profile_map = self._build_profile_map()
370 # If a profile is not explicitly set return the default
371 # profile config or an empty config dict if we don't have
372 # a default profile.
373 if profile_name is None:
374 return profile_map.get('default', {})
375 elif profile_name not in profile_map:
376 # Otherwise if they specified a profile, it has to
377 # exist (even if it's the default profile) otherwise
378 # we complain.
379 raise ProfileNotFound(profile=profile_name)
380 else:
381 return profile_map[profile_name]
382
383 @property
384 def full_config(self):

Callers 13

create_clientMethod · 0.95
provideMethod · 0.45
add_timestamp_parserFunction · 0.45
_get_sso_configMethod · 0.45
_get_runtime_configMethod · 0.45
_create_crt_clientMethod · 0.45
__init__Method · 0.45
_run_mainMethod · 0.45
_run_mainMethod · 0.45
_run_mainMethod · 0.45
get_configsFunction · 0.45

Calls 3

get_config_variableMethod · 0.95
_build_profile_mapMethod · 0.95
ProfileNotFoundClass · 0.90

Tested by

no test coverage detected