403Webshell
Server IP : 178.105.222.151  /  Your IP : 216.73.216.38
Web Server : nginx/1.28.3
System : Linux MNK 7.0.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Wed Apr 22 16:06:43 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.5.4
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/cloudinit/config/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/cloudinit/config/__pycache__/cc_rh_subscription.cpython-314.pyc
+
��i�@���a�Rt0tRt^RIt^RIHtHt^RIHt^RIH	t	^RI
Ht^RIH
t
]P!]4tRRR	R
R.R]
R
R./t]^kRRlt!RR]4t!RR4tRRltR#)zDRed Hat Subscription: Register Red Hat Enterprise Linux based systemN)�subp�util)�Cloud)�Config)�
MetaSchema)�PER_INSTANCE�id�cc_rh_subscription�distros�fedora�rhel�	frequency�activate_by_schema_keys�rh_subscriptionc
�L�V^8�dQhR\R\R\R\RR/#)��name�cfg�cloud�args�returnN)�strrr�list)�formats"�E/usr/lib/python3/dist-packages/cloudinit/config/cc_rh_subscription.py�__annotate__rs/��71�71��71�6�71�%�71�t�71��71�c��\V4pVP4'g\PRV4R#VP	4'Eg�VP4wrVVRJd\
V4hVP4pV'g\
R4hVP'dFVPe8VP4'g\
R4h\PR4MHVP'd7VP4'g\
R4h\PR4VPeu\VP\4'gRp\
V4hVPVP4p	V	'g%\
R	P!VP44hVP#4p	V	'g\
R
4hVP$'d!VP'4VP)4\P+R4R#\P+R
4R# \d?p
\P-\/T
44\P-R4Rp
?
R#Rp
?
ii;i)z%s: module not configured.NTz-Registration failed or did not run completelyzSetting of service_level failedz(Completed auto_attach with service levelzSetting auto_attach failedzCompleted auto_attachz"Pools must in the format of a listzUnable to attach pools {0}zUnable to add or remove reposz-rh_subscription plugin completed successfullyz4rh_subscription plugin did not complete successfullyzSystem is already registered)�SubscriptionManager�
is_configured�LOG�debug�
is_registered�_verify_keys�SubscriptionError�rhn_register�auto_attach�servicelevel�_set_service_level�_set_auto_attach�pools�
isinstancer�addPoolr�update_repos�release_version�_set_release_version�_delete_packagemanager_cache�info�warningr)rrrr�sm�verify�
verify_msg�cont�	pool_fail�return_stat�es&&&&       r�handler:s���	�S�	!�B�
������	�	�.��5��
�����.	P�!#���!2��F��T�!�'�
�3�3��?�?�$�D��'�C����~�~�~�"�/�/�"=��,�,�.�.�+�,M�N�N��I�I�H�I������*�*�,�,�+�,H�I�I��I�I�5�6��x�x�#�!�"�(�(�D�1�1� D�I�+�I�6�6� �j�j����2��"�+�4�;�;�B�H�H�E����/�/�+�K��'�(G�H�H��!�!�!��'�'�)��/�/�1��H�H�D�E�
	���/�0��	!�	P��K�K��A����K�K�N�O�O��	P�sI�:H<�
H<�*#H<�2H<�H<�A=H<�;H<�H<�.5H<�<J�3J�Jc��]tRt^TtRtR#)r$�N)�__name__�
__module__�__qualname__�__firstlineno__�__static_attributes__r<rrr$r$Ts��rr$c�na�]tRt^XtoRtRtRtRtRtRt	Rt
RtR	tR
t
RtRtR
tRtVtR#)rc���VPR/4VnVPPR4VnVPPR4VnVPPR4VnVPPR4VnVPPRVPPR44VnVPPRVPPR44VnVPPR	VPPR
44VnVPPRVPPR44Vn	VPPR
VPPR44Vn
VPPRVPPR44VnVPPRVPPR44VnVPPRVPPR44Vn
R#)r�org�username�passwordr.�rhsm_baseurlzrhsm-baseurl�server_hostnamezserver-hostname�add_poolzadd-pool�activation_keyzactivation-keyr&zauto-attach�enable_repozenable-repo�disable_repozdisable-repo�
service_levelz
service-levelN)�get�rhel_cfgrD�useridrFr.rGrHr*rJr&rKrLr')�selfrs&&r�__init__�SubscriptionManager.__init__Zs������ 1�2�6��
��=�=�$�$�U�+����m�m�'�'�
�3����
�
�)�)�*�5��
�#�}�}�0�0�1B�C���!�M�M�-�-��D�M�M�-�-�n�=�
��� $�}�}�0�0��t�}�}�0�0�1B�C� 
����]�]�&�&���
�
�)�)�*�5�
��
�#�m�m�/�/��d�m�m�/�/�0@�A�
��� �=�=�,�,��4�=�=�,�,�]�;�
��� �=�=�,�,��4�=�=�,�,�]�;�
���!�M�M�-�-��D�M�M�-�-�n�=�
���!�M�M�-�-��T�]�]�.�.��?�
��rc�p�VPeS\P!VP4'g-\P!VP4'gRpRV3#VPeHVP'd0\P!\VP44'dRpRV3#R#)zY
Checks that the keys in the rh_subscription dict from the user-data
are what we expect.
z8The key auto_attach must be a boolean value (True/False)FzqThe service_level key must be used in conjunction with the auto_attach key.  Please re-run with auto_attach: True)TN)r&r�is_true�is_falser'r)rQ�not_bool�no_autos&  rr#� SubscriptionManager._verify_keyss���
���(��L�L��)�)�*�*�d�m�m�D�<L�<L�.M�.M�K�
��(�?�"����)��!�!�!�t�}�}�S��9I�9I�5J�'K�'K�$�
�
�'�>�!��rc�\�R.p\V4R# \PdR#i;i)zO
Checks if the system is already registered and returns
True if so, else False
�identityFT)�_sub_man_clir�ProcessExecutionError)rQ�cmds& rr"�!SubscriptionManager.is_registered�s7��
�l��	�������)�)�	��	�s��+�+c��VPe�VPe�RRPVP4RPVP4.pVPe+VP	RPVP44VP
e+VP	RPVP
44\
VRR7^,pEMVPe�VPe�RRPVP4R
PVP4.pVPe+VP	RPVP44VP
e+VP	RPVP
44\
VRR7^,pM,\PR4\PR4R#VPR4^,P!4p\P#RV4R# \Pd=pTPR	8Xd!\PR
TP4Rp?R#Rp?ii;i \Pd=pTPR	8Xd!\PR
TP4Rp?R#Rp?ii;i)zv
Registers the system by userid and password or activation key
and org.  Returns True when successful False when not.
N�registerz--activationkey={0}z	--org={0}z
--baseurl={0}z--serverurl={0}T)�
logstring_val�zRegistration failed due to: %sFz--username={0}z--password={0}z8Unable to register system due to incomplete information.z9Use either activationkey and org *or* userid and passwordzID: z"Registered successfully with ID %s)rJrDrrG�appendrHr\rr]�stdoutr r2�stderrrPrF�split�rstripr!)rQr^�
return_outr9�reg_ids&    rr%� SubscriptionManager.rhn_register�s/��
���+�$�(�(�2F��%�,�,�T�-@�-@�A��"�"�4�8�8�,��C�� � �,��
�
�?�1�1�$�2C�2C�D�E��#�#�/��
�
�,�3�3�D�4H�4H�I�J�
�)�#�T�B�1�E�
��k�k�%�D�M�M�,E�� �'�'����4� �'�'��
�
�6��C�� � �,��
�
�?�1�1�$�2C�2C�D�E��#�#�/��
�
�,�3�3�D�4H�4H�I�J�
�)�#�T�B�1�E�
�
�K�K�J�
�
�K�K�K�
���!�!�&�)�!�,�3�3�5���	�	�6��?���S�-�-�
��8�8�r�>��K�K� @�!�(�(�K���
��2�-�-�
��8�8�r�>��K�K� @�!�(�(�K���
�s0�H�I2�I/�31I*�*I/�2K�1J>�>Kc�6�RRRPVP4.p\V4^,pTPR4F!pTR8wgK\PT4K#	R# \Pd�pTP
P
4R8wdBTP
PR4F!pTR8wgK\PT4K#	M.\PRTPP44Rp?R#Rp?ii;i)	�attach�--autoz--servicelevel={0}rc�
z)Setting the service level failed with: %sNFT)
rr'r\rr]rerhrgr r2rf�stripr!�rQr^rir9�lines&    rr(�&SubscriptionManager._set_service_level�s����� �'�'��(9�(9�:�
��	�%�c�*�1�-�J��$�$�T�*�D��r�z��	�	�$��+����)�)�
	��x�x��� �B�&��H�H�N�N�4�0�D��r�z����D�)�1����?��H�H�N�N�$����
	�s�A*�*D�?AD�AD�Dc��RR.p\V4^,pTPR4F!pTR8wgK\P
T4K#	R# \Pd"p\P	RT4Rp?R#Rp?ii;i)rmrnzauto_attach failed with: %sNFrorcT)r\rr]r r2rgr!rqs&    rr)�$SubscriptionManager._set_auto_attachsx����"��	�%�c�*�1�-�J��$�$�T�*�D��r�z��	�	�$��+���
�)�)�	��K�K�5�q�9���	�s�A�B�%B�Bc���.p.p.ROp\V4^,pVP4PR4p.ROp\V4^,pVP4PR4pW3#)zP
Gets the list pools for the active subscription and returns them
in list form.
ro)rz--available�--pool-only)rz
--consumedrw)r\rhrg)rQ�	available�consumedr^�resultss&    r�	_getPools�SubscriptionManager._getPoolssq��
�	���5���s�#�A�&���^�^�%�,�,�T�2�	�4���s�#�A�&���N�N�$�+�+�D�1���"�"rc��RR.p\V4^,p.pVPR4FApRV9gKVPVPR4^,P44KC	RR.p\V4^,p.pVPR4FApRV9gKVPVPR4^,P44KC	W53#)zT
Obtains the current list of active yum repositories and returns
them in list form.
�reposz--list-enabledrozRepo ID:�:z--list-disabled)r\rgrdrp)rQr^ri�active_repos�repo�inactive_reposs&     r�	_getRepos�SubscriptionManager._getRepos+s����(�)��!�#�&�q�)�
����$�$�T�*�D��T�!��#�#�T�Z�Z��_�Q�%7�$>�$>�$@�A�+��)�*��!�#�&�q�)�
����$�$�T�*�D��T�!��%�%�t�z�z�#��q�'9�&@�&@�&B�C�+��+�+rc�H�V'g\PR4R#VP4wr#.pR.pVFGpWc9d)Wb9d#VPRP	V44K1\PRV4KI	\
V4^8�dUVPV4\V4\PRRPV4PRR	44R#R# \Pd#p\PR
XT4Rp?R#Rp?ii;i)
zT
Takes a list of subscription pools and "attaches" them to the
current subscription
zNo pools to attachTrmz
--pool={0}zPool %s is not availablez/Attached the following pools to your system: %s�, z--pool=rcz"Unable to attach pool %s due to %sNF)
r r!r{rdrr2�len�extendr\�join�replacerr])rQr*�pool_available�
pool_consumed�	pool_listr^�poolr9s&&      rr,�SubscriptionManager.addPoolAs�����I�I�*�+��(,���(8�%���	��j���D��)��0F�� � ��!4�!4�T�!:�;����6��=�	�
�y�>�A���J�J�y�!�	
��S�!��	�	�E��Y�Y�y�)�2�2�9�b�A������-�-�
����@�$��J���
�s�&AC*�*D!�?D�D!c��VPpVPpVf.pVf.p\V\4'g\PR4R#\V\4'g\PR4R#V'g V'g\P
R4R#VP4wr4.p.pVF<pWt9d#VPRPV44K+VPV4K>	.p.p	VF<pWs9d#VPRPV44K+V	PV4K>	\V4^8�d>VF7p
W�9d\P
RV
4K!\PR	V
4K9	\V	4^8�d V	Fp
\P
R
V
4K	R.p\V4^8�dVPV4\V4^8�dVPV4\V4\T4^8�d6\P
R
RPT4P!RR44\T4^8�d6\P
RRPT4P!RR44R# \Pd"p\PRT4Rp?R#Rp?ii;i)z�
Takes a list of yum repo ids that need to be disabled or enabled; then
it verifies if they are already enabled or disabled and finally
executes the action to disable or enable
Nz&Repo IDs must in the format of a list.Fz No repo IDs to enable or disableTz--enable={0}z
--disable={0}zRepo %s is already enabledz Repo %s does not appear to existz.Repo %s not disabled because it is not enabledr~zUnable to alter repos due to %szEnabled the following repos: %sr�z	--enable=rcz Disabled the following repos: %sz
--disable=)rKrLr+rr r2r!r�rdrr�r�r\rr]r�r�)
rQ�erepos�dreposr�r��enable_list�enable_list_fail�repoid�disable_list�disable_list_fail�failr^r9s
&            rr-� SubscriptionManager.update_reposasb���!�!���"�"���>��F��>��F��&�$�'�'��K�K�@�A���&�$�'�'��K�K�@�A�����I�I�8�9��'+�~�~�'7�$�������F��'��"�"�>�#8�#8��#@�A� �'�'��/�	������F��%��#�#�O�$:�$:�6�$B�C�!�(�(��0�	��� �1�$�(���'��I�I�:�D�A��K�K� B�D�I�)�� �!�A�%�)���	�	�D�d��*�
�i���|��q� ��J�J�|�$��{��a���J�J�{�#�	����
�{��a���I�I�1����;�'�0�0��b�A�
��|��q� ��I�I�2����<�(�1�1�,��C�
����)�)�	��K�K�9�1�=���	�s�J�K�2K�Kc�|�\VP;'dVP;'g
VP4#)N)�boolrPrFrJ)rQs&rr�!SubscriptionManager.is_configured�s+���T�[�[�2�2�T�]�]�J�J�t�7J�7J�K�Krc��RRVP2.p\V4R# \Pdp\	RT24ThRp?ii;i)zo
Execute "subscription-manager release --set=<release_version>"
Raises Subscription error if the command fails
�releasez--set=z%Unable to set release_version using: N)r.r\rr]r$)rQr^r9s&  rr/�(SubscriptionManager._set_release_version�sY���F�4�#7�#7�"8�9�:��	������)�)�	�#�7��u�=���
��	�s� �A	�A�A	c���\PR4\P!R4\P!R4R# \dp\R4ThRp?ii;i)zS
Delete the package manager cache.
Raises Subscription error if the deletion fails
z"Deleting the package manager cachez/var/cache/dnfz/var/cache/yumz*Unable to delete the package manager cacheN)r r!r�del_dir�	Exceptionr$)rQr9s& rr0�0SubscriptionManager._delete_packagemanager_cache�sS��
	�	�	�6�7�	��L�L�)�*��L�L�)�*���	�#�<���
��	�s�,A�A!�A�A!)
rJr&rLrKrDrFr*r.rOrGrHr'rPN)r=r>r?r@rRr#r"r%r(r)r{r�r,r-rr/r0rA�__classdictcell__)�
__classdict__s@rrrXsS����#
�J�B�B�H�2
�#�(,�,�@R�hL���rrc�B�\P!R.V,VR7#)z�
Uses the preferred cloud-init subprocess def of subp.subp
and runs subscription-manager.  Breaking this to a
separate function for later use in mocking and unittests
zsubscription-manager)�	logstring)r)r^rbs&&rr\r\�s���9�9�,�-��3�}�M�Mrc�@�V^8�dQh/^\9d
\;R&#)r�meta)�__conditional_annotations__r)rs"rrrs��J�J���j��Kr)F)r��__doc__�logging�	cloudinitrr�cloudinit.cloudr�cloudinit.configr�cloudinit.config.schemar�cloudinit.settingsr�	getLoggerr=r r�r:r�r$rr\r)r�s@r�<module>r�s���K�� �!�#�.�+�
����!��	�
�
��&�!���� 1�2�	���71�t	�	�	�z�z�zNr

Youez - 2016 - github.com/yon3zu
LinuXploit