| Server IP : 156.238.232.47 / Your IP : 216.73.216.150 Web Server : nginx/1.25.3 System : Linux C202504152095410 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : www ( 1000) PHP Version : 8.3.25 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /lib/python2.7/site-packages/cloudinit/cmd/ |
Upload File : |
�
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&