OS : Linux
PHP Version : 7.4.33
Software : Apache/2.4.6 (CentOS) PHP/7.4.33
Information System : Linux apprendre2 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
Disable Function : ó oBú]c @ sÁ d Z d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z m Z m Z m Z m Z m Z d „ Z d d „ Z e d „ Z d „ Z d „ Z e d k r½ e ƒ n d S( sE Define 'clean' utility and handler as part of cloud-init commandline.iÿÿÿÿN( t Init( t ProcessExecutionErrort del_dirt del_filet get_config_logfilest is_linkt subpc C s t j j d | d ƒ d S( Ns ERROR: s ( t syst stderrt write( t msg( ( s7 /usr/lib/python2.7/site-packages/cloudinit/cmd/clean.pyt error s c C s— | s! t j d d d d ƒ } n | j d d d d d t d d d d ƒ| j d d d d d t d d ƒ| j d d d d d t d d d d ƒ| S( s# 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. t progt cleant descriptionsA Remove logs and artifacts so cloud-init re-runs on a clean systems -ls --logst actiont store_truet defaultt destt remove_logst helps Remove cloud-init logs.s -rs --reboots; Reboot system after logs are cleaned so cloud-init re-runs.s -ss --seedt remove_seeds5 Remove cloud-init seed directory /var/lib/cloud/seed.( t argparset ArgumentParsert add_argumentt False( t parser( ( s7 /usr/lib/python2.7/site-packages/cloudinit/cmd/clean.pyt get_parser s c C s+ t d g ƒ } | j ƒ | rF x$ t | j ƒ D] } t | ƒ q/ Wn t j j | j j ƒ sb d St j j | j j d ƒ } x§ t j d | j j ƒ D]Œ } | | k r¶ | r¶ q— n y: t j j | ƒ rå t | ƒ rå t | ƒ n t | ƒ Wq— t k r"} t d j | t | ƒ ƒ ƒ d SXq— Wd S( s4 Helper which removes artifacts dir and optionally log files. @param: remove_logs: Boolean. Set True to delete the cloud_dir path. False preserves them. @param: remove_seed: Boolean. Set True to also delete seed subdir in paths.cloud_dir. @returns: 0 on success, 1 otherwise. t ds_depsi t seeds %s/*s Could not remove {0}: {1}i ( R t read_cfgR t cfgR t ost patht isdirt pathst cloud_dirt joint globR R t OSErrorR t formatt str( R R t initt log_filet seed_pathR! t e( ( s7 /usr/lib/python2.7/site-packages/cloudinit/cmd/clean.pyt remove_artifacts0 s&