HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-10-0-8-47 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:31:58 UTC 2024 aarch64
User: ubuntu (1000)
PHP: 8.1.2-1ubuntu2.22
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/cloudinit/config/__pycache__/cc_spacewalk.cpython-310.pyc
o

�Ad�@s�UdZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZd	Zd
dded
dgeed�gdgd�Zeed<e
e�ZddgZdgZdZdd�Zedddfdd�Zdede
dededed dfd!d"�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/
�cc_spacewalk�	SpacewalkzInstall and configure spacewalk�rhel�fedoraz�            spacewalk:
              server: <url>
              proxy: <proxy host>
              activation_key: <key>
            �	spacewalk)�id�name�title�description�distros�	frequency�examples�activate_by_schema_keys�meta�redhatz	rhn-setupz'/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERTc
CsVd}ztjddgdd�d}W|Stjy*}z
|jdkr�WYd}~|Sd}~ww)NFzrhn-profile-syncz	--verbose��captureT�)r�ProcessExecutionError�	exit_code)�already_registered�e�r �?/usr/lib/python3/dist-packages/cloudinit/config/cc_spacewalk.py�
is_registered3s�

���r"NcCs�|dur|�d||�dg}|�dd|g�|�dt|�g�|r+|�dt|�g�|r6|�dt|�g�|rA|�dt|�g�tj|d	d
�dS)Nz;Registering using `rhnreg_ks` profile '%s' into server '%s'�	rhnreg_ksz--serverUrlzhttps://%s/XMLRPCz
--profilenamez--proxyz--sslCACertz--activationkeyFr)�info�extend�strr)�server�profile_name�ca_cert_path�proxy�log�activation_key�cmdr r r!�do_registerAs �r.r�cfg�cloudr+�args�returncCs�d|vr|�d|�dS|d}|�d�}|r9|j�t�t�s7t||jjdd�j	|�d�||�d�d�dSdS|�d	|�dS)
Nrz=Skipping module named %s, no 'spacewalk' key in configurationr'T)�fqdnr*r,)r*r+r,zOSkipping module named %s, 'spacewalk/server' key was not found in configuration)
�debug�get�distro�install_packages�required_packagesr"r.�
datasource�get_hostname�hostname)rr/r0r+r1�spacewalk_serverr r r!�handle[s.�

��	�r=)�__doc__�loggingr�textwrapr�	cloudinitr�cloudinit.cloudr�cloudinit.configr�cloudinit.config.schemarr�cloudinit.settingsr	�MODULE_DESCRIPTIONr�__annotations__rr8�def_ca_cert_pathr"r.r&�listr=r r r r!�<module>sX��
�
�������