관리-도구
편집 파일: cc_landscape.cpython-39.opt-1.pyc
a ����'�Dg;����������������������@���s����U�d�Z�ddlZddlmZ�ddlmZ�ddlmZmZm Z �ddl mZ�ddlm Z �ddlmZ�dd lmZ�d Zddd ddd�iZddgedgd�Zeed<�e�e�Zee eedd�dd�Zdd��ZdS�)z&install and configure landscape client�����N)�chain)� ConfigObj)�subp� type_utils�util)�Cloud)�Config)� MetaSchema)�PER_INSTANCEz/etc/landscape/client.conf�client�infoz.https://landscape.canonical.com/message-systemz#http://landscape.canonical.com/pingz/var/lib/landscape/client)Z log_level�urlZping_urlZ data_pathZcc_landscapeZubuntu� landscape)�idZdistrosZ frequencyZactivate_by_schema_keys�meta)�name�cfg�cloud�args�returnc����������� ��� ���C���s����|��di��}t|t�s,tdjt�|�d���|s4dS�|j�dg��t t |g}ttdd��t t|�d�����D�����}z*tjg�d �d gd��t�dd g|���W�n\�tjy��}�zB|jdkr�t�d��n d|���}t�t|��t|�|�W�Y�d}~n d}~0�0�dS�)z� Basically turn a top level 'landscape' entry with a 'client' dict and render it to ConfigObj format under '[client]' section in /etc/landscape/client.conf r���zR'landscape' key existed in config, but not a dictionary type, is a {_type} instead)Z_typeNzlandscape-clientc�����������������S���s&���g�|�]\}}d�|��dd����|g�qS�)z--�_�-)�replace)�.0�k�v��r����A/usr/lib/python3.9/site-packages/cloudinit/config/cc_landscape.py� <listcomp>I���s����zhandle.<locals>.<listcomp>r���)�landscape-config�--silentz--is-registered����)Zrcsr���r ���r���z&Client already registered to LandscapezFailure registering client: )�get� isinstance�dict�RuntimeError�formatr���Zobj_nameZdistroZinstall_packages�LSC_BUILTIN_CFG�LSC_CLIENT_CFG_FILE�listr����sorted�merge_together�itemsr���ZProcessExecutionErrorZ exit_code�LOGZwarningr���Zlogexc) r���r���r���r���Zls_cloudcfgZ merge_dataZ cmd_params�e�msgr���r���r����handle,���s@���� ������� r0���c�����������������C���s@���t�i��}|�D�].}|sqt|t��r,|�|��q|�t�|���q|S�)zu merge together ConfigObj objects or things that ConfigObj() will take in later entries override earlier )r���r#����merge)Zobjsr����objr���r���r���r+���]���s���� r+���)�__doc__Zlogging� itertoolsr���Z configobjr���Z cloudinitr���r���r���Zcloudinit.cloudr���Zcloudinit.configr���Zcloudinit.config.schemar ���Zcloudinit.settingsr ���r(���r'���r����__annotations__Z getLogger�__name__r-����strr)���r0���r+���r���r���r���r����<module> ���s0����� � 1