
"·T`æ  ã               @   sï   d  Z  d d l m Z d d l m Z d d l m Z m Z d d l m	 Z	 e	 Z
 d g Z d d d	 d
 d d d e d ƒ d e d e d ƒ e d ƒ g d e
 d d d d d d d d i d d d d d i i i	 Z e e ƒ Z  d d „  Z d S)zLocale: set system localeé    )Údedent)Úutil)Úget_schema_docÚvalidate_cloudconfig_schema)ÚPER_INSTANCEÚallÚidZ	cc_localeÚnameZLocaleÚtitlezSet system localeZdescriptionz|        Configure the system locale and apply it system wide. By default use
        the locale specified by the datasource.ÚdistrosZexampleszL            # Set the locale to ar_AE
            locale: ar_AE
            z¤            # Set the locale to fr_CA in /etc/alternate_path/locale
            locale: fr_CA
            locale_configfile: /etc/alternate_path/locale
            Ú	frequencyÚtypeÚobjectZ
propertiesÚlocaleÚstringz5The locale to set as the system's locale (e.g. ar_PS)Úlocale_configfilez_The file in which to write the locale configuration (defaults to the distro's default location)c             C   s¦   t  | ƒ d k r | d } n t j | d | j ƒ  ƒ } t j | ƒ r` | j d |  | ƒ d  St | t ƒ | j d | ƒ t j | d ƒ } | j j	 | | ƒ d  S)Nr   r   z0Skipping module named %s, disabled by config: %szSetting locale to %sr   )
Úlenr   Zget_cfg_option_strZ
get_localeZis_falseÚdebugr   ÚschemaZdistroZapply_locale)r	   ZcfgZcloudÚlogÚargsr   Zlocale_cfgfile© r   ú</usr/lib/python3/dist-packages/cloudinit/config/cc_locale.pyÚhandle?   s    	
r   N)Ú__doc__Útextwrapr   Z	cloudinitr   Zcloudinit.config.schemar   r   Zcloudinit.settingsr   r   r   r   r   r   r   r   r   Ú<module>	   s<   		