File: //snap/core22/current/lib/python3/dist-packages/cloudinit/cmd/__pycache__/clean.cpython-310.pyc
o
x[h� � @ s� d Z ddlZddlZddlZddlZddlmZ ddlmZ ddl m
Z
ddlmZ ddl
mZ ddlmZmZmZ dd lmZmZmZmZmZ d
Zeddd
ddgZdgZddd�Zddd�Zdd� Zdd� Ze dkrpe� dS dS )zFDefine 'clean' utility and handler as part of cloud-init command line.� N)�settings)�uses_systemd)�log_util)�CLOUDINIT_NETPLAN_FILE)�Init)�ProcessExecutionError�runparts�subp)�del_dir�del_file�get_config_logfiles�is_link�
write_filez/etc/machine-idz-/etc/NetworkManager/conf.d/99-cloud-init.confz?/etc/NetworkManager/conf.d/30-cloud-init-ip6-addr-gen-mode.confz@/etc/NetworkManager/system-connections/cloud-init-*.nmconnectionz,/etc/systemd/network/10-cloud-init-*.networkz+/etc/network/interfaces.d/50-cloud-init.cfgz)/etc/ssh/sshd_config.d/50-cloud-init.confc C s� | s t jddd�} | jdddddd d
� | jddddd
� | jdddddd
� | jddddddd
� | jddg d�g dddd� | S )a# Build or extend an arg parser for clean utility.
@param parser: Optional existing ArgumentParser instance representing the
clean subcommand which will be extended to support the args of
this utility.
@returns: ArgumentParser with proper argument configuration.
�cleanzJRemove logs, configs and artifacts so cloud-init re-runs on a clean system)�prog�descriptionz-lz--logs�
store_trueF�remove_logszRemove cloud-init logs.)�action�default�dest�helpz--machine-idz�Set /etc/machine-id to 'uninitialized
' for golden imagecreation. On next boot, systemd generates a new machine-id. Remove /etc/machine-id on non-systemd environments.)r r r z-rz--rebootz;Reboot system after logs are cleaned so cloud-init re-runs.z-sz--seed�remove_seedz5Remove cloud-init seed directory /var/lib/cloud/seed.z-cz --configs)�all�
ssh_config�network�+�
remove_configzbRemove cloud-init generated config files of a certain type. Config types: all, ssh_config, network)�choicesr �nargsr r )�argparse�ArgumentParser�add_argument��parser� r% �5/usr/lib/python3/dist-packages/cloudinit/cmd/clean.py�
get_parser* sX ���
���r'