ó ÞtÚ_c@s¤dZddlZddlZddlmZejeƒZidddgddfd6dRd6dSd 6dTd 6dUd6ddidfd6dVd6ddde fd6ddde fd6dWd6dde dfd6dde dfd6dde ej fd6dXd 6d#d$d%e fd#6dYd&6dZd)6d[d,6d\d/6d1d2de fd16Z id^d46d_ddej fd56d`ddej fd66daddej fd76d8dbgd:dej fd96d;dcgd=ddfd<6Zd>„Zd?„Zd@efdA„ƒYZdBefdC„ƒYZdDefdE„ƒYZdFefdG„ƒYZdHefdI„ƒYZdJefdK„ƒYZdLefdM„ƒYZdNefdO„ƒYZdPefdQ„ƒYZdS(dsOThis module contains the inteface for controlling how configuration is loaded. iÿÿÿÿN(tutilstAWS_DEFAULT_PROFILEt AWS_PROFILEtprofiletregiontAWS_DEFAULT_REGIONt data_patht AWS_DATA_PATHtAWS_CONFIG_FILEs ~/.aws/configt config_filet ca_bundlet AWS_CA_BUNDLEt api_versionstAWS_SHARED_CREDENTIALS_FILEs~/.aws/credentialstcredentials_filetmetadata_service_timeouttAWS_METADATA_SERVICE_TIMEOUTitmetadata_service_num_attemptst!AWS_METADATA_SERVICE_NUM_ATTEMPTStec2_metadata_service_endpointt!AWS_EC2_METADATA_SERVICE_ENDPOINTt imds_use_ipv6tAWS_IMDS_USE_IPV6tparameter_validationt csm_enabledtAWS_CSM_ENABLEDtcsm_hostt AWS_CSM_HOSTs 127.0.0.1tcsm_portt AWS_CSM_PORTiyt csm_client_idtAWS_CSM_CLIENT_IDttendpoint_discovery_enabledtAWS_ENDPOINT_DISCOVERY_ENABLEDtautotsts_regional_endpointstAWS_STS_REGIONAL_ENDPOINTStlegacyt retry_modetAWS_RETRY_MODEt max_attemptstAWS_MAX_ATTEMPTSts3taddressing_styletuse_accelerate_endpointtuse_dualstack_endpointtpayload_signing_enabledts3_use_arn_regiontuse_arn_regiontAWS_S3_USE_ARN_REGIONts3_us_east_1_regional_endpointtus_east_1_regional_endpointt"AWS_S3_US_EAST_1_REGIONAL_ENDPOINTcCsAtd|ƒ}t|tƒ}td|t|tƒƒ|d<|S(NtsessionR+(tConfigChainFactoryt_create_config_chain_mappingt!BOTOCORE_DEFAUT_SESSION_VARIABLEStSectionConfigProvidertDEFAULT_S3_CONFIG_VARS(R6t chain_buildertconfig_mapping((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pyt&create_botocore_default_config_mapping„s  c Csei}xX|jƒD]J\}}|jd|d|dd|dd|dd|d ƒ|| config_property_name -> default. Any values that were none are omitted form the chain. t instance_varR6tvaluet providersRCN( RKtappendtInstanceVarProviderRJtextendt_get_env_providerst_get_scoped_config_providerstConstantProvidert ChainProvider(ROR?R@RARBRCRS((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pyRE³s (    cCsUg}t|tƒs!|g}nx-|D]%}|jtd|d|jƒƒq(W|S(Ntnametenv(t isinstancetlistRTtEnvironmentProviderRN(ROR@tenv_var_providerst env_var_name((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pyRWñs  cCsUg}t|tƒs!|g}nx-|D]%}|jtd|d|jƒƒq(W|S(Ntconfig_var_nameR6(R]R^RTtScopedConfigProviderRJ(RORAtscoped_config_providerstconfig_property_name((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pyRXûs  N(t__name__t __module__t__doc__RKRPRERWRX(((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pyR7œs  < tConfigValueStorecBs>eZdZdd„Zd„Zd„Zd„Zd„ZRS(s8The ConfigValueStore object stores configuration values.cCsRi|_i|_|dk rNx-|jƒD]\}}|j||ƒq+WndS(sNInitialize a ConfigValueStore. :type mapping: dict :param mapping: The mapping parameter is a map of string to a subclass of BaseProvider. When a config variable is asked for via the get_config_variable method, the corresponding provider will be invoked to load the value. N(t _overridest_mappingRKRDtset_config_provider(RORGRHtprovider((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pyRP s   cCsD||jkr|j|S||jkr-dS|j|}|jƒS(s Retrieve the value associeated with the specified logical_name from the corresponding provider. If no value is found None will be returned. :type logical_name: str :param logical_name: The logical name of the session variable you want to retrieve. This name will be mapped to the appropriate environment variable name for this session as well as the appropriate config file entry. :returns: value of variable or None if not defined. N(RjRkRKtprovide(RORHRm((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pytget_config_variables   cCs||j|>> # Assume logical name 'foo' maps to env var 'FOO' >>> os.environ['FOO'] = 'myvalue' >>> s.get_config_variable('foo') 'myvalue' >>> s.set_config_variable('foo', 'othervalue') >>> s.get_config_variable('foo') 'othervalue' :type logical_name: str :param logical_name: The logical name of the session variable you want to set. These are the keys in ``SESSION_VARIABLES``. :param value: The value to associate with the config variable. N(Rj(RORHRR((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pytset_config_variable/scCs|jj|dƒdS(sÃRemove an override config variable from the session. :type logical_name: str :param logical_name: The name of the parameter to clear the override value from. N(RjtpopRK(RORH((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pytclear_config_variableIscCs||j|This class loads config values from the session instance vars.cCs||_||_dS(s>Initialize InstanceVarProvider. :type instance_var: str :param instance_var: The instance variable to load from the session. :type session: :class:`botocore.session.Session` :param session: The botocore session to get the loaded configuration file variables from. N(t _instance_varRJ(RORQR6((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pyRPžs cCs%|jjƒ}|j|jƒ}|S(s6Provide a config value from the session instance vars.(RJtinstance_variablestgetR|(ROt instance_varsRR((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pyRn«scCsd|j|jfS(Ns0InstanceVarProvider(instance_var=%s, session=%s)(R|RJ(RO((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pyR{±s(RfRgRhRPRnR{(((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pyRUœs RccBs#eZd„Zd„Zd„ZRS(cCs||_||_dS(s2Initialize ScopedConfigProvider. :type config_var_name: str or tuple :param config_var_name: The name of the config variable to load from the configuration file. If the value is a tuple, it must only consist of two items, where the first item represents the section and the second item represents the config var name in the section. :type session: :class:`botocore.session.Session` :param session: The botocore session to get the loaded configuration file variables from. N(t_config_var_nameRJ(RORbR6((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pyRP¹s cCsn|jjƒ}t|jtƒr^|j|jdƒ}t|tƒsJdS|j|jdƒS|j|jƒS(s,Provide a value from a config file property.iiN(RJtget_scoped_configR]R€ttupleR~tdictRK(ROt scoped_configtsection_config((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pyRnÉscCsd|j|jfS(Ns4ScopedConfigProvider(config_var_name=%s, session=%s)(R€RJ(RO((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pyR{Ós(RfRgRPRnR{(((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pyRc¸s  R_cBs)eZdZd„Zd„Zd„ZRS(s:This class loads config values from environment variables.cCs||_||_dS(sInitialize with the keys in the dictionary to check. :type name: str :param name: The key with that name will be loaded and returned. :type env: dict :param env: Environment variables dictionary to get variables from. N(t_namet_env(ROR[R\((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pyRPÜs cCs$|j|jkr |j|jSdS(s0Provide a config value from a source dictionary.N(R†R‡RK(RO((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pyRnèscCsd|j|jfS(Ns$EnvironmentProvider(name=%s, env=%s)(R†R‡(RO((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pyR{îs(RfRgRhRPRnR{(((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pyR_Ús R:cBs,eZdZdd„Zd„Zd„ZRS(sÈProvides a dictionary from a section in the scoped config This is useful for retrieving scoped config variables (i.e. s3) that have their own set of config variables and resolving logic. cCsR||_||_t|j|jƒ|_||_|jdkrNi|_ndS(N(t _section_nameRJRct_scoped_config_providert_override_providersRK(ROt section_nameR6toverride_providers((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pyRPøs   cCs|jjƒ}|r?t|tƒ r?tjd|j|ƒdSxW|jj ƒD]F\}}|jƒ}|dk rO|dkrˆi}n|||R8tobjectR7RiRsRZRURcR_R:RY(((sB/opt/awscli/lib/python2.7/site-packages/botocore/configprovider.pytsp    m[ -"(