Ë
    ‹c×eÜ  ã                   óx   — d Z ddlZddlZddlmZ  G d„ dej
                  «      Z G d„ dej                  «      Zy)a©  
Environment
-----------

The **environment** backend driver provides a method of accessing
configuration data in environment variables. It is enabled by default
and requires no additional configuration to use. The environment is
checked after command line options, but before configuration files.


Environment variables are checked for any configuration data. The variable
names take the form:

* A prefix of ``OS_``
* The group name, uppercased
* Separated from the option name by a `__` (double underscore)
* Followed by the name

For an option that looks like this in the usual INI format::

    [placement_database]
    connection = sqlite:///

the corresponding environment variable would be
``OS_PLACEMENT_DATABASE__CONNECTION``.

The Driver Class
================

.. autoclass:: EnvironmentConfigurationSourceDriver

The Configuration Source Class
==============================

.. autoclass:: EnvironmentConfigurationSource

é    N)Úsourcesc                   ó   — e Zd ZdZd„ Zd„ Zy)Ú$EnvironmentConfigurationSourceDriverzâA backend driver for environment variables.

    This configuration source is available by default and does not need special
    configuration to use. The sample config is generated automatically but is
    not necessary.
    c                 ó   — g S )z%There are no options for this driver.© )Úselfs    úB/usr/lib/python3/dist-packages/oslo_config/sources/_environment.pyÚlist_options_for_discoveryz?EnvironmentConfigurationSourceDriver.list_options_for_discoveryD   s   € àˆ	ó    c                 ó   — t        «       S ©N)ÚEnvironmentConfigurationSource)r   ÚconfÚ
group_names      r	   Úopen_source_from_opt_groupz?EnvironmentConfigurationSourceDriver.open_source_from_opt_groupH   s   € Ü-Ó/Ð/r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   r   r   r	   r   r   <   s   „ ñòó0r   r   c                   ó&   — e Zd ZdZed„ «       Zd„ Zy)r   z6A configuration source for options in the environment.c                 ój   — | xs d} dj                  | j                  «       |j                  «       «      S )a  Return the expected environment variable name for the given option.

        :param group_name: The group name or None. Defaults to 'DEFAULT' if
            None.
        :param option_name: The option name.
        :returns: Th expected environment variable name.
        ÚDEFAULTz	OS_{}__{})ÚformatÚupper)r   Úoption_names     r	   Úget_namez'EnvironmentConfigurationSource.get_nameO   s3   € ð  Ò, 9ˆ
Ø×!Ñ! *×"2Ñ"2Ó"4°k×6GÑ6GÓ6IÓJÐJr   c                 ó  — | j                  ||«      }	 t        j                  |   }t        j                  j                  t        j                  j                  j                  |«      }||fS # t        $ r t        j                  d fcY S w xY wr   )r   ÚosÚenvironÚoslo_configÚcfgÚLocationInfoÚ	LocationsÚenvironmentÚKeyErrorr   Ú_NoValue)r   r   r   ÚoptÚenv_nameÚvalueÚlocs          r	   Úgetz"EnvironmentConfigurationSource.get[   sy   € Ø—=‘= ¨[Ó9ˆð	,Ü—J‘J˜xÑ(ˆEÜ—/‘/×.Ñ.Ü—‘×)Ñ)×5Ñ5°xóAˆCà˜3<ÐøÜò 	,Ü×$Ñ$ dÐ+Ò+ð	,ús   ”AA- Á-BÂ
BN)r   r   r   r   Ústaticmethodr   r+   r   r   r	   r   r   L   s   „ Ù@àñ	Kó ð	Kó,r   r   )	r   r   Úoslo_config.cfgr    r   ÚConfigurationSourceDriverr   ÚConfigurationSourcer   r   r   r	   ú<module>r0      s<   ðñ$óL 
ó Ý ô0¨7×+LÑ+Lô 0ô , W×%@Ñ%@õ ,r   