Your IP : 216.73.217.13


Current Path : /usr/lib/python3/dist-packages/cloudinit/config/__pycache__/
Upload File :
Current File : //usr/lib/python3/dist-packages/cloudinit/config/__pycache__/cc_spacewalk.cpython-38.pyc

U

�Ad�	@s�UdZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZd	Zd
dded
dgeed�gdgd�Zeed<e
e�ZddgZdgZdZdd�Zedddfdd�Zee
eeedd�dd�ZdS)z*Spacewalk: Install and configure spacewalk�)�Logger)�dedent)�subp)�Cloud)�Config)�
MetaSchema�get_meta_doc)�PER_INSTANCEa�This module installs spacewalk and applies basic configuration. If the
``spacewalk`` config key is present spacewalk will be installed. The server to
connect to after installation must be provided in the ``server`` in spacewalk
configuration. A proxy to connect through and a activation key may optionally
be specified.

For more information about spacewalk see: https://fedorahosted.org/spacewalk/
Zcc_spacewalkZ	SpacewalkzInstall and configure spacewalkZrhelZfedoraz�            spacewalk:
              server: <url>
              proxy: <proxy host>
              activation_key: <key>
            �	spacewalk)�id�name�titleZdescription�distrosZ	frequencyZexamplesZactivate_by_schema_keys�metaZredhatz	rhn-setupz'/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERTc
CsTd}ztjddgdd�d}Wn0tjk
rN}z|jdkr>�W5d}~XYnX|S)NFzrhn-profile-syncz	--verbose�ZcaptureT�)rZProcessExecutionErrorZ	exit_code)Zalready_registered�e�r�?/usr/lib/python3/dist-packages/cloudinit/config/cc_spacewalk.py�
is_registered3s
rNcCs�|dk	r|�d||�dg}|�dd|g�|�dt|�g�|rV|�dt|�g�|rl|�dt|�g�|r�|�dt|�g�tj|d	d
�dS)Nz;Registering using `rhnreg_ks` profile '%s' into server '%s'Z	rhnreg_ksz--serverUrlzhttps://%s/XMLRPCz
--profilenamez--proxyz--sslCACertz--activationkeyFr)�info�extend�strr)�serverZprofile_nameZca_cert_path�proxy�log�activation_key�cmdrrr�do_registerAs �r)r�cfg�cloudr�args�returncCs|d|kr|�d|�dS|d}|�d�}|rl|j�t�t�sxt||jjdd�j	|�d�||�d�d�n|�d	|�dS)
Nr
z=Skipping module named %s, no 'spacewalk' key in configurationrT)Zfqdnrr)rrrzOSkipping module named %s, 'spacewalk/server' key was not found in configuration)
�debug�getZdistroZinstall_packages�required_packagesrrZ
datasourceZget_hostnameZhostname)rrr rr!Zspacewalk_serverrrr�handle[s,�
��r&)�__doc__Zloggingr�textwraprZ	cloudinitrZcloudinit.cloudrZcloudinit.configrZcloudinit.config.schemarrZcloudinit.settingsr	ZMODULE_DESCRIPTIONr�__annotations__rr%Zdef_ca_cert_pathrrr�listr&rrrr�<module>sJ��
��
�