+
    iP                        a  R t0 t R t^ RIt^ RIt^ RIHtHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHt ^ RIHt RR	R
].R]R. /t] ^ k RtRtRtRt]P*                  ! ]4      tRtR R ltR tR tR tR tR tR# )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idcc_reset_rmcdistros	frequencyactivate_by_schema_keys z/opt/rsct/install/binrmcctrlrecfgctz/etc/ct_node_idc          
      L    V ^8  d   QhR\         R\        R\        R\        RR/# )   namecfgcloudargsreturnN)strr   r   list)formats   "?/usr/lib/python3/dist-packages/cloudinit/config/cc_reset_rmc.py__annotate__r   <   s/     # # #6 #% #t # #    c                    VP                   P                  R 8X  d   \        P                  R4       R# \        P
                  P                  \        4      '       g   \        P                  R4       R# \        P                  P                  R4      p \        V4       \        4        V'       d   V\        P                  R&   R# \        P                  R R#   T'       d   T\        P                  R&   i \        P                  R i ; i)nonez(Skipping creation of new ct_node_id nodeNz&module disabled, RSCT_PATH not presentPATH)
datasourceplatform_typeLOGdebugospathisdir	RSCT_PATHenvirongetadd_path	reset_rmc)r   r   r   r   	orig_paths   &&&& r   handler.   <   s    %%/		<=77==##		:;

v&I#!*BJJv

6" !*BJJv

6"s   C /Dc                       \         P                   ! \        .4      ^ ,          p \        P                  V P	                  4       4       V #   \         P
                   d    \        P                  ! \        R4       h i ; i)    z*Failed to reconfigure the RSCT subsystems.)r   RECFGCTr#   r$   stripProcessExecutionErrorr   logexc)outs    r   reconfigure_rsct_subsystemsr6   Q   sZ    ii	"1%		#))+
%% CEFs   AA	 	2A;c                       \         P                  ! \        4      p V P                  R 4      ^ ,          pV#   \         d)    \         P
                  ! \        R\        ,          4       h i ; i)
z#Failed to get node ID from file %s.)r   load_text_fileNODE_ID_FILEsplit	Exceptionr4   r#   )fpnode_ids     r   get_node_idr?   ^   sT      .((4.# C>MNs	   36 3A)c                     V '       d
   R V ,           MRp\         V,           \        P                  R&   \        P                  R,          # ):r   r    )r(   r%   r)   )r-   suffs   & r   r+   r+   h   s3     (3?RD"T)BJJv::fr   c                       \         P                   ! \        R .4      #   \         d    \        P                  ! \
        R4       h i ; i)z-zz!Failed to stop the RMC subsystem.)r   RMCCTRLr<   r   r4   r#    r   r   r   r   q   s;    yy'4)) C<=s	    (Ac                  (   \         P                  R 4       \        4       p \         P                  RV 4       \        4        \	        4        \        4       p\         P                  RV4       W8X  d#   Rp\         P                  V4       \        V4      hR# )zAttempting to reset RMC.z"Node ID at beginning of module: %szNode ID at end of module: %sz"New node ID did not get generated.N)r#   r$   r?   r   r6   errorRuntimeError)node_id_beforenode_id_aftermsgs      r   r,   r,   {   sp    II() ]NII2NC I!MMII,m< &2		#3 'r   c                @    V ^8  d   Qh/ ^ \         9   d
   \        ;R&   # )r   meta)__conditional_annotations__r   )r   s   "r   r   r      s"      > j ?r   ) rN   __doc__loggingr%   	cloudinitr   r   cloudinit.cloudr   cloudinit.configr   cloudinit.config.schemar   cloudinit.distrosr   cloudinit.settingsr   rM   r(   rD   r1   	getLogger__name__r#   r:   r.   r6   r?   r+   r   r,   r   )rN   s   @r   <module>rY      s   *  	   ! # . ) + 	.}r	   $	

! #*
 r   