HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /lib/python3/dist-packages/cloudinit/config/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/cloudinit/config/__pycache__/cc_reset_rmc.cpython-311.pyc
�

܍~c"���UdZddlZddlmZddlmZddlmZmZddlm	Z	ddl
mZddlm
Z
dd	lmZdd
lmZdZdd
deegeggd�Ze
ed<dZdZdZdZeje��ZdZdedede	dededdfd�Zd�Zd�Z d�Z!d �Z"d!�Z#dS)"zReset RMC: Reset rsct node id�N)�Logger)�log)�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�cloudr�args�returnc���|jjdkrt�d��dStj�t��st�d��dStj�	d��}	t|��t��|r|tjd<dStjd=dS#|r|tjd<n
tjd=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)rrrrr�	orig_paths      �?/usr/lib/python3/dist-packages/cloudinit/config/cc_reset_rmc.py�handler.Ds���
��%��/�/��	�	�<�=�=�=���
�7�=�=��#�#���	�	�:�;�;�;����
���v�&�&�I�#�����������	#�!*�B�J�v�����
�6�"�"�"���	#�!*�B�J�v����
�6�"�"�"�"�"s�
C�!C-c��	tjtg��d}t�|�����|S#tj$rt
jtd���wxYw)Nrz*Failed to reconfigure the RSCT subsystems.)r�RECFGCTr"r#�strip�ProcessExecutionErrorr�logexc)�outs r-�reconfigure_rsct_subsystemsr5[sp����i��	�"�"�1�%���	�	�#�)�)�+�+�����
���%������C�E�F�F�F�
����s�A
A�+A;c���	tjt��}|�d��d}|S#t$r$tjtdtz���wxYw)N�
rz#Failed to get node ID from file %s.)r�	load_file�NODE_ID_FILE�split�	Exceptionr3r")�fp�node_ids  r-�get_node_idr>hse���
�^�L�
)�
)���(�(�4�.�.��#�����������C�>��M�N�N�N�
����s	�58�.A&c�f�|rd|znd}t|ztjd<tjdS)N�:rr)r'r$r()r,�suffs  r-r*r*rs4��(�/�3��?�?�R�D�"�T�)�B�J�v��
�:�f���c��	tjtdg��S#t$rtjt
d���wxYw)Nz-zz!Failed to stop the RMC subsystem.)r�RMCCTRLr;rr3r"�rBr-rr{sL����y�'�4��)�)�)��������C�<�=�=�=�
����s	��&Ac�x�t�d��t��}t�d|��t��t	��t��}t�d|��||kr+d}t�|��t
|���dS)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>rr5�errorr;)�node_id_before�
node_id_after�msgs   r-r+r+�s����I�I�(�)�)�)� �]�]�N��I�I�2�N�C�C�C��I�I�I��!�!�!��M�M�M��I�I�,�m�<�<�<���&�&�2���	�	�#������n�n��'�&rB)$�__doc__r$�loggingr�	cloudinitrrr�cloudinit.cloudr�cloudinit.configr�cloudinit.config.schemar	�cloudinit.distrosr
�cloudinit.settingsr�MODULE_DESCRIPTIONr�__annotations__r'rDr0�	getLogger�__name__r"r9�str�listr.r5r>r*rr+rErBr-�<module>rYs���$�#�#�
�	�	�	�������$�$�$�$�$�$� � � � � � � � �!�!�!�!�!�!�#�#�#�#�#�#�.�.�.�.�.�.�)�)�)�)�)�)�+�+�+�+�+�+���,��
!�%��}���!�	�	��j�	�	�	�
��
$�	�
��
���g���!�!�� ��#�

�#��#�#(�#�/5�#�=A�#�	�#�#�#�#�.
�
�
��������������rB