Server IP : 209.38.156.173 / Your IP : 216.73.216.122 [ 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/cmd/devel/__pycache__/ |
Upload File : |
o x[h�- � @ st d Z ddlZddlZddlZddlZddlZddlZddlZddlm Z m Z mZ ddlm Z ddlmZmZ ddlmZ ddlmZ ddlmZ dd lmZ dd lmZmZ ddlmZ e�e�Z dZ!d$d d�Z"G dd� dej#�Z$G dd� de$�Z%de%ej&fiZ'dd� Z(dede)fdd�Z*deddfdd�Z+d%dd�Z,dede-fdd �Z.d!d"� Z/ed#kr�e"� �0� Z1e/e!e1� dS dS )&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)�Initzhotplug-hookc C s� | s t jttd�} t| _| jdddddgd� | jdd d �}d|_|jddd � |jddd �}|jdddddd� |jddddddgd� |jddd � | S )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 �metavarr z-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_handle� r) �B/usr/lib/python3/dist-packages/cloudinit/cmd/devel/hotplug_hook.py� get_parser sL �������r+ c @ s` e Zd Zdd� Zejdd� �Zeejdd� ��Zejde fdd ��Z d d� Zdd � Zdd� Z dS )� UeventHandlerc C s"