403Webshell
Server IP : 23.254.227.96  /  Your IP : 216.73.216.46
Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64
User : viralblo ( 1001)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.6/site-packages/cloudinit/cmd/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.6/site-packages/cloudinit/cmd/__pycache__/status.cpython-36.opt-1.pyc
3

��b�@s�dZddlZddlZddlZddlZddlmZmZmZddl	m
Z
ddlmZddl
mZmZmZdZejGdd	�d	ej��Zdd
d�Zdd
�Zdd�Zddd�Zdd�Zedkr�e�dS)zFDefine 'status' utility and handler as part of cloud-init commandline.�N)�gmtime�sleep�strftime)�uses_systemd)�Init)�get_cmdline�	load_file�	load_jsonz/etc/cloud/cloud-init.disabledc@s$eZdZdZdZdZdZdZdZdS)�UXAppStatusz=Enum representing user-visible cloud-init application status.znot runZrunning�done�error�disabledN)	�__name__�
__module__�__qualname__�__doc__�NOT_RUN�RUNNING�DONE�ERROR�DISABLED�rr�/usr/lib/python3.6/status.pyr
sr
cCs>|stjddd�}|jdddddd	�|jd
ddddd	�|S)
a%Build or extend an arg parser for status utility.

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

    @returns: ArgumentParser with proper argument configuration.
    �statuszReport run status of cloud init)�prog�descriptionz-lz--long�
store_trueFzJReport long format of statuses including run stage name and error messages)�action�default�helpz-wz--waitz'Block waiting on cloud-init to complete)�argparse�ArgumentParser�add_argument)�parserrrr�
get_parser s 	
r$cCs�tgd�}|j�t|j�\}}}|jrxxB|tjtjfkrjtj	j
d�tj	j�t|j�\}}}td�q*Wtj	j
d�t
dj|j��|jr�|r�t
dj|��t
dj|��|tjkr�dSd	S)
z4Handle calls to 'cloud-init status' as a subcommand.)�ds_deps�.g�?�
zstatus: {0}z	time: {0}zdetail:
{0}�r)r�read_cfg�get_status_details�paths�waitr
rr�sys�stdout�write�flushr�print�format�valueZlongr)�name�args�initr�
status_detail�timerrr�handle_status_argsAs 

r9cCs�d}t�j�}t�sd}n�d|kr(d}nrtjj|�rDd}dj|�}nVd|krVd}d}nDtjjtjj|jd	��rxd}d
}n"tjjtjj|jd��r�d}nd
}||fS)aReport whether cloud-init is disabled.

    @param disable_file: The path to the cloud-init disable file.
    @param paths: An initialized cloudinit.helpers.Paths object.
    @returns: A tuple containing (bool, reason) about cloud-init's status and
    why.
    FzCloud-init enabled on sysvinitzcloud-init=enabledz<Cloud-init enabled by kernel command line cloud-init=enabledTzCloud-init disabled by {0}zcloud-init=disabledz;Cloud-init disabled by kernel parameter cloud-init=disabledr
z+Cloud-init disabled by cloud-init-generatorZenabledz2Cloud-init enabled by systemd cloud-init-generatorz'Systemd generator may not have run yet.)	r�splitr�os�path�existsr2�join�run_dir)Zdisable_filer+�is_disabledZ
cmdline_parts�reasonrrr�_is_cloudinit_disabledVs&
rBcCs�|stgd�}|j�|j}tj}d}i}tjj|jd�}tjj|jd�}t	t
|�\}}|rftj}|}tjj|�r�tjj|�s�tj
}tt|��jdi�}g}	d}
x�t|j��D]�\}}|dkr�|r�tj
}dj|�}q�|d	kr�|}q�t|t�r�|	j|jd
g��|jd��pd}
|jd��pd}|dk�r8|
dk�r8tj
}t|
|�}||
kr�|}
q�W|	�rjtj}d
j|	�}n|tjk�r�|
dk�r�tj}|
�r�tdt|
��}nd}|||fS)z�Return a 3-tuple of status, status_details and time of last event.

    @param paths: An initialized cloudinit.helpers.paths object.

    Values are obtained from parsing paths.run_dir/status.json.
    )r%�zstatus.jsonzresult.jsonZv1rZstagezRunning in stage: {0}Z
datasource�errors�start�finishedr'z%a, %d %b %Y %H:%M:%S %z)rr)r+r
rr;r<r>r?rB�CLOUDINIT_DISABLED_FILErr=rr	r�get�sorted�itemsr2�
isinstance�dict�extend�maxrrrr)r+r6rr7Z	status_v1Zstatus_fileZresult_filer@rArDZlatest_event�keyr3rErFZ
event_timer8rrrr*tsZ


r*cCst�}tjtd|j���dS)z$Tool to report status of cloud-init.rN)r$r-�exitr9�
parse_args)r#rrr�main�srR�__main__)N)N)rr �enumr;r-r8rrrZcloudinit.distrosrZcloudinit.stagesrZcloudinit.utilrrr	rG�unique�Enumr
r$r9rBr*rRrrrrr�<module>s$


!
;

Youez - 2016 - github.com/yon3zu
LinuXploit