name : cc_mcollective.cpython-39.pyc
a

'�Dgo�@s�UdZddlZddlZddlZddlmZddlmZmZddl	m
Z
ddlmZddl
mZddlmZd	Zd
ZdZdd
gedgd�Zeed<e�e�Zeeefdd�Zeee
edd�dd�ZdS)z5Mcollective: Install, configure and start mcollective�N)�	ConfigObj)�subp�util)�Cloud)�Config)�
MetaSchema)�PER_INSTANCEz&/etc/mcollective/ssl/server-public.pemz'/etc/mcollective/ssl/server-private.pemz/etc/mcollective/server.cfgZcc_mcollective�all�mcollective)�idZdistrosZ	frequencyZactivate_by_schema_keys�metac
Cs�z tj|dd�}tt�|��}WnFtyf}z.|jtjkr@�nt�	d|�t�}WYd}~n
d}~00|�
�D]�\}}|dkr�tj||dd�||d<d|d	<qp|d
kr�tj||dd�||d<d|d	<qpt|t
�r�|||<qpt|t��r ||jvr�i||<|�
�D]\}	}
|
|||	<�qqpt
|�||<qpzt�|d
|�Wn8t�yz}z|jtjk�rdn�WYd}~n
d}~00t��}|�|�tj||��dd�dS)NF)�quietz4Did not find file %s (starting with an empty config)zpublic-certi�)�modezplugin.ssl_server_publicZsslZsecurityproviderzprivate-certi�zplugin.ssl_server_privatez%s.old)rZload_binary_filer�io�BytesIO�IOError�errno�ENOENT�LOG�debug�itemsZ
write_file�
isinstance�str�dictZsections�copy�write�getvalue)�configZ
server_cfgZpubcert_fileZpricert_fileZold_contentsZmcollective_config�eZcfg_name�cfg�o�v�contents�r#�C/usr/lib/python3.9/site-packages/cloudinit/config/cc_mcollective.py�	configure(sJ�





r%)�namer�cloud�args�returncCsZd|vrt�d|�dS|d}|j�dg�d|vrDt|dd�tjgd�dd�dS)Nr
z?Skipping module named %s, no 'mcollective' key in configurationZconf)r)Zservicer
ZrestartF)Zcapture)rrZdistroZinstall_packagesr%r)r&rr'r(Zmcollective_cfgr#r#r$�handlees�r*)�__doc__rrZloggingZ	configobjrZ	cloudinitrrZcloudinit.cloudrZcloudinit.configrZcloudinit.config.schemarZcloudinit.settingsrZPUBCERT_FILEZPRICERT_FILEZ
SERVER_CFGr�__annotations__Z	getLogger�__name__rr%r�listr*r#r#r#r$�<module>
s.�
�
=

© 2025 Cubjrnet7