ó ¼z]c@sºdZddlZddlmZidddgddfd6d8d6d9d 6d:d 6d;d6ddidfd6d<d6dddefd6dddefd6ddedfd6ddeejfd6d=d6dd d!efd6d>d"6d%d&eejfd%6Z d'„Z d(e fd)„ƒYZ d*e fd+„ƒYZ d,e fd-„ƒYZd.efd/„ƒYZd0efd1„ƒYZd2efd3„ƒYZd4efd5„ƒYZd6efd7„ƒYZdS(?sOThis 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_ATTEMPTStparameter_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_ENABLEDc Csei}xXtjƒD]J\}}|jd|d|dd|dd|dd|d ƒ|| config_property_name -> default. Any values that were none are omitted form the chain. t instance_varR3tnamestenvtconfig_var_nametvaluet providersR#N( R.tappendtInstanceVarProviderR-tEnvironmentProviderR1tScopedConfigProvidertConstantProvidert ChainProvider(R2RR R!R"R#R:((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pyR&ys*'    N(t__name__t __module__t__doc__R.R4R&(((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pyR,bs  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_mappingR.R%tset_config_provider(R2R(R)tprovider((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pyR4Á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(RERFR.tprovide(R2R)RH((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pytget_config_variableÐs   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(RE(R2R)R9((s9/tmp/pip-build-kBFYxq/botocore/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(REtpopR.(R2R)((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pytclear_config_variableÿscCs||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_varR-(R2R5R3((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pyR4Ts cCs%|jjƒ}|j|jƒ}|S(s6Provide a config value from the session instance vars.(R-tinstance_variablestgetRW(R2t instance_varsR9((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pyRIascCsd|j|jfS(Ns0InstanceVarProvider(instance_var=%s, session=%s)(RWR-(R2((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pyRVgs(RARBRCR4RIRV(((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pyR<Rs R>cBs#eZd„Zd„Zd„ZRS(cCs||_||_dS(sfInitialize ScopedConfigProvider. :type config_var_name: str :param config_var_name: The name of the config variable to load from the configuration file. :type session: :class:`botocore.session.Session` :param session: The botocore session to get the loaded configuration file variables from. N(t_config_var_nameR-(R2R8R3((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pyR4os cCs%|jjƒ}|j|jƒ}|S(s,Provide a value from a config file property.(R-tget_scoped_configRYR[(R2R*R9((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pyRI}scCsd|j|jfS(Ns4ScopedConfigProvider(config_var_name=%s, session=%s)(R[R-(R2((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pyRVƒs(RARBR4RIRV(((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pyR>ns  R=cBs)eZdZd„Zd„Zd„ZRS(s:This class loads config values from environment variables.cCs||_||_dS(süInitialize with the keys in the dictionary to check. :type names: str or list :param names: If this is a str, the key with that name will be loaded and returned. If this variable is a list, then it must be a list of str. The same process will be repeated for each string in the list, the first that returns non None will be returned. :type env: dict :param env: Environment variables dictionary to get variables from. N(t_namest_env(R2R6R7((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pyR4Œs cCsS|j}t|tƒs$|g}nx(|D] }||jkr+|j|Sq+WdS(s0Provide a config value from a source dictionary.N(R]t isinstancetlistR^R.(R2R6tname((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pyRIœs   cCsd|j|jfS(Ns%EnvironmentProvider(names=%s, env=%s)(R]R^(R2((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pyRV¦s (RARBRCR4RIRV(((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pyR=Šs  R?cBs)eZdZd„Zd„Zd„ZRS(s(This provider provides a constant value.cCs ||_dS(N(t_value(R2R9((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pyR4­scCs|jS(s7Provide the constant value given during initialization.(Rb(R2((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pyRI°scCs d|jS(NsConstantProvider(value=%s)(Rb(R2((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pyRV´s(RARBRCR4RIRV(((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pyR?«s  (RRNN(RRNN(NRs ~/.aws/configN(R R NN(NR s~/.aws/credentialsN(RRs 127.0.0.1N(RRRN(RCR/tbotocoreRR.tinttTruetFalsetensure_booleanR$R+tobjectR,RDRNR@R<R>R=R?(((s9/tmp/pip-build-kBFYxq/botocore/botocore/configprovider.pyts>  ][ -!