%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/cloudinit/config/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/cloudinit/config/__pycache__/cc_reset_rmc.cpython-312.pyc

�

���f��
��UdZddlZddlZddlmZmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZd	Zd
ddee
geggd
�Zeed<dZdZdZdZej,e�ZdZdede	dededdf
d�Zd�Zd�Zd�Zd�Z d�Z!y)zReset RMC: Reset rsct node id�N)�subp�util)�Cloud)�Config)�
MetaSchema)�ALL_DISTROS)�PER_INSTANCEa|Reset RMC module is IBM PowerVM Hypervisor specific

Reliable Scalable Cluster Technology (RSCT) is a set of software components,
that  together provide a comprehensive clustering environment (RAS features)
for IBM PowerVM based virtual machines. RSCT includes the Resource monitoring
and control (RMC) subsystem. RMC is a generalized framework used for managing,
monitoring, and manipulating resources. RMC runs as a daemon process on
individual machines and needs creation of unique node id and restarts
during VM boot.
More details refer
https://www.ibm.com/support/knowledgecenter/en/SGVKBA_3.2/admin/bl503_ovrv.htm

This module handles
- creation of the unique RSCT node id to every instance/virtual machine
  and ensure once set, it isn't changed subsequently by cloud-init.
  In order to do so, it restarts RSCT service.

Prerequisite of using this module is to install RSCT packages.
�cc_reset_rmcz	Reset RMCzreset rsct node id)�id�name�title�description�distros�	frequency�examples�activate_by_schema_keys�meta�z/opt/rsct/install/bin�rmcctrl�recfgctz/etc/ct_node_idr�cfg�cloud�args�returnc���|jjdk(rtjd�ytj
j
t�stjd�ytjjd�}	t|�t�|r|tjd<ytjd=y#|r|tjd<wtjd=wxYw)N�nonez(Skipping creation of new ct_node_id nodez&module disabled, RSCT_PATH not present�PATH)�
datasource�
platform_type�LOG�debug�os�path�isdir�	RSCT_PATH�environ�get�add_path�	reset_rmc)rrrr�	orig_paths     �?/usr/lib/python3/dist-packages/cloudinit/config/cc_reset_rmc.py�handler,As������%�%��/��	�	�<�=��
�7�7�=�=��#��	�	�:�;���
�
���v�&�I�#�������!*�B�J�J�v���
�
�6�"���!*�B�J�J�v���
�
�6�"�s�	C�)C/c���	tjtg�d}tj|j	��|S#tj
$rt
jtd��wxYw)Nrz*Failed to reconfigure the RSCT subsystems.)r�RECFGCTr r!�strip�ProcessExecutionErrorr�logexc)�outs r+�reconfigure_rsct_subsystemsr3VsZ����i�i��	�"�1�%���	�	�#�)�)�+���
���%�%�����C�E�F�
��s�AA�/A3c��	tjt�}|jd�d}|S#t$r#tj
tdtz��wxYw)N�
rz#Failed to get node ID from file %s.)r�load_text_file�NODE_ID_FILE�split�	Exceptionr1r )�fp�node_ids  r+�get_node_idr<csT���
�
 �
 ��
.���(�(�4�.��#����������C�>��M�N�
��s	�.1�,Ac�n�|rd|znd}t|ztjd<tjdS)N�:rr)r%r"r&)r*�suffs  r+r(r(ms3��(�3��?�R�D�"�T�)�B�J�J�v��
�:�:�f���c��	tjtdg�S#t$rtjt
d��wxYw)Nz-zz!Failed to stop the RMC subsystem.)r�RMCCTRLr9rr1r �r@r+rrvs;����y�y�'�4��)�)�������C�<�=�
��s	��%Ac�$�tjd�t�}tjd|�t�t	�t�}tjd|�||k(r"d}tj|�t
|��y)NzAttempting to reset RMC.z"Node ID at beginning of module: %szNode ID at end of module: %sz"New node ID did not get generated.)r r!r<rr3�error�RuntimeError)�node_id_before�
node_id_after�msgs   r+r)r)�sr���I�I�(�)� �]�N��I�I�2�N�C��I��!��M�M��I�I�,�m�<���&�2���	�	�#���3���'r@)"�__doc__�loggingr"�	cloudinitrr�cloudinit.cloudr�cloudinit.configr�cloudinit.config.schemar�cloudinit.distrosr�cloudinit.settingsr	�MODULE_DESCRIPTIONr�__annotations__r%rBr.�	getLogger�__name__r r7�str�listr,r3r<r(rr)rCr@r+�<module>rXs���$��	� �!�#�.�)�+���,��
!�%��}���!�	��j�	�
��
$�	�
��
���g����!�� ��#��#�6�#�%�#�t�#��#�*
���� r@

Zerion Mini Shell 1.0