AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/cloudinit/config/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/cloudinit/config/__pycache__/cc_reset_rmc.cpython-310.pyc
o

x[hP�
@s�UdZddlZddlZddlmZmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZd	e
gegd
�Zeed<dZd
ZdZdZe�e�ZdZdede	dededdf
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Z dS)!a�Reset RMC: Reset rsct node id

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.
�N)�subp�util)�Cloud)�Config)�
MetaSchema)�ALL_DISTROS)�PER_INSTANCE�cc_reset_rmc)�id�distros�	frequency�activate_by_schema_keys�meta�z/opt/rsct/install/bin�rmcctrl�recfgctz/etc/ct_node_id�name�cfg�cloud�args�returnc	Cs�|jjdkr
t�d�dStj�t�st�d�dStj�	d�}zt
|�t�W|r2|tjd<dStjd=dS|r@|tjd<wtjd=w)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)rrrr�	orig_path�r&�?/usr/lib/python3/dist-packages/cloudinit/config/cc_reset_rmc.py�handle<s 

�
r(cCsDzt�tg�d}t�|���|WStjy!t�td��w)Nrz*Failed to reconfigure the RSCT subsystems.)r�RECFGCTrr�strip�ProcessExecutionErrorr�logexc)�outr&r&r'�reconfigure_rsct_subsystemsQs�r.cCs@zt�t�}|�d�d}|WStyt�tdt��w)N�
rz#Failed to get node ID from file %s.)r�load_text_file�NODE_ID_FILE�split�	Exceptionr,r)�fp�node_idr&r&r'�get_node_id^s
�r6cCs(|rd|nd}t|tjd<tjdS)N�:rr)r rr!)r%�suffr&r&r'r#hs
r#cCs.zt�tdg�WStyt�td��w)Nz-zz!Failed to stop the RMC subsystem.)r�RMCCTRLr3rr,rr&r&r&r'rqs�cCs\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.)rrr6rr.�error�RuntimeError)�node_id_before�
node_id_after�msgr&r&r'r${s

�r$)!�__doc__�loggingr�	cloudinitrr�cloudinit.cloudr�cloudinit.configr�cloudinit.config.schemar�cloudinit.distrosr�cloudinit.settingsrr�__annotations__r r9r)�	getLogger�__name__rr1�str�listr(r.r6r#rr$r&r&r&r'�<module>s4�


	

Anon7 - 2022
AnonSec Team