| Server IP : 23.254.227.96 / Your IP : 216.73.216.183 Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64 User : viralblo ( 1001) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3.6/site-packages/cloudinit/config/__pycache__/ |
Upload File : |
3
��b�? � @ sh d Z ddlmZ ddlmZmZ eje�ZddgZ dd� Z
G dd � d e�ZG d
d� de
�Zdd
d�ZdS )a&
Red Hat Subscription
--------------------
**Summary:** register red hat enterprise linux based system
Register a Red Hat system either by username and password *or* activation and
org. Following a sucessful registration, you can auto-attach subscriptions, set
the service level, add subscriptions based on pool id, enable/disable yum
repositories based on repo id, and alter the rhsm_baseurl and server-hostname
in ``/etc/rhsm/rhs.conf``. For more details, see the ``Register Red Hat
Subscription`` example config.
**Internal name:** ``cc_rh_subscription``
**Module frequency:** per instance
**Supported distros:** rhel, fedora
**Config keys**::
rh_subscription:
username: <username>
password: <password>
activation-key: <activation key>
org: <org number>
auto-attach: <true/false>
service-level: <service level>
add-pool: <list of pool ids>
enable-repo: <list of yum repo ids>
disable-repo: <list of yum repo ids>
rhsm-baseurl: <url>
server-hostname: <hostname>
� )�log)�subp�utilZfedoraZrhelc C sj t ||d�}|j� s$|jd| � d S |j� �s\y�|j� \}}|dk rLt|��|j� }|s`td��|jr�|jd k r�|j � s�td��q�|j
jd� n$|jr�|j� s�td��n|j
jd� |jd k � r�t
|jt�s�d } t| ��|j|j�}
|
� s�td
j|j���|j� }
|
�std��|jd� W n< tk
�rX } z|jt|�� |jd
� W Y d d }~X nX n
|jd� d S )N)r z%s: module not configured.Tz-Registration failed or did not run completelyzSetting of service-level failedz(Completed auto-attach with service levelzSetting auto-attach failedzCompleted auto-attachz"Pools must in the format of a listzUnable to attach pools {0}zUnable to add or remove reposz-rh_subscription plugin completed successfullyz4rh_subscription plugin did not complete successfullyzSystem is already registered)�SubscriptionManager�
is_configured�debug�
is_registered�_verify_keys�SubscriptionError�rhn_register�auto_attach�servicelevel�_set_service_levelr �_set_auto_attach�pools�
isinstance�list�addPool�format�update_repos�log_success�log_warn�str)�name�cfgZ_cloudr Z_argsZsmZverifyZ
verify_msgZcontZ pool_failZreturn_stat�e� r �(/usr/lib/python3.6/cc_rh_subscription.py�handle1 sJ
r c @ s e Zd ZdS )r
N)�__name__�
__module__�__qualname__r r r r r
g s r
c @ s� e Zd Zddddddddd d
dgZd'd
d�Zdd� Zdd� Zdd� Zdd� Zdd� Z dd� Z
dd� Zdd� Zdd � Z
d!d"� Zd#d$� Zd%d&� ZdS )(r �orgzactivation-key�username�passwordzdisable-repozenable-repozadd-poolzrhsm-baseurlzserver-hostnamezauto-attachz
service-levelNc C s� |d krt }|| _|| _| jjdi �| _| jjd�| _| jjd�| _| jjd�| _| jjd�| _| jjd�| _ | jjd�| _
| jjd�| _| jjd �| _| jjd
�| _
| jjd�| _| jjd�| _d S )
NZrh_subscriptionzrhsm-baseurlzserver-hostnamezadd-poolzactivation-keyr"