403Webshell
Server IP : 3.96.16.70  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3.9/site-packages/cloudinit/cmd/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.9/site-packages/cloudinit/cmd/__pycache__/status.cpython-39.pyc
a

�½b��@s�dZddlZddlZddlZddlZddlmZmZmZddl	m
Z
ddlmZddl
mZddlmZmZmZdZejGd	d
�d
ej��Zddd�Zed
�dd�Zdd�Zde
eeefd
�dd�Zdd�Zedkr�e�dS)zFDefine 'status' utility and handler as part of cloud-init commandline.�N)�gmtime�sleep�strftime)�Tuple)�read_cfg_paths)�uses_systemd)�get_cmdline�	load_file�	load_jsonz/etc/cloud/cloud-init.disabledc@s$eZdZdZdZdZdZdZdZdS)�UXAppStatusz=Enum representing user-visible cloud-init application status.znot runZrunningZdone�error�disabledN)	�__name__�
__module__�__qualname__�__doc__�NOT_RUN�RUNNING�DONE�ERROR�DISABLED�rr�8/usr/lib/python3.9/site-packages/cloudinit/cmd/status.pyrsrcCs>|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%)�returncCs�t�}t|�\}}}|jrd|tjtjfvrXtj�d�tj�	�t|�\}}}t
d�qtj�d�td�|j
��|jr�|r�td�|��td�|��|tjkr�dSdS)	z4Handle calls to 'cloud-init status' as a subcommand.�.g�?�
zstatus: {0}z	time: {0}zdetail:
{0}�r)r�get_status_details�waitrrr�sys�stdout�write�flushr�print�format�valueZlongr)�name�args�pathsr�
status_detail�timerrr�handle_status_argsDs

r8cCs�d}t���}t�sd}n�d|vr(d}nrtj�|�rDd}d�|�}nVd|vrVd}d}nDtj�tj�|jd	��rxd}d
}n"tj�tj�|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�existsr1�join�run_dir)Zdisable_filer5�is_disabledZ
cmdline_parts�reasonrrr�_is_cloudinit_disabledXs&
rAcCs�|pt�}tj}d}i}tj�|jd�}tj�|jd�}tt|�\}}|rTtj	}|}tj�
|�r�tj�
|�srtj}tt
|���di�}g}d}	t|���D]�\}
}|
dkr�|r�tj}d�|�}q�|
dkr�|}q�t|t�r�|�|�d	g��|�d
�p�d}|�d��pd}
|
dk�r"|dk�r"tj}t||
�}||	kr�|}	q�|�rRtj}d�|�}n|tjk�rn|	dk�rntj}|	�r�td
t|	��}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.
    �zstatus.jsonzresult.jsonZv1rZstagezRunning in stage: {0}Z
datasource�errors�start�finishedr(z%a, %d %b %Y %H:%M:%S %z)rrrr:r;r=r>rA�CLOUDINIT_DISABLED_FILErr<rr
r	�get�sorted�itemsr1�
isinstance�dict�extend�maxrrrr)r5rr6Z	status_v1Zstatus_fileZresult_filer?r@rCZlatest_event�keyr2rDrEZ
event_timer7rrrr*vsV
�

r*cCst�}t�td|����dS)z$Tool to report status of cloud-init.rN)r%r,�exitr8�
parse_argsr#rrr�main�srQ�__main__)N)N)rr �enumr:r,r7rrr�typingrZcloudinit.cmd.develrZcloudinit.distrosrZcloudinit.utilrr	r
rF�unique�Enumrr%�intr8rA�strr*rQrrrrr�<module>s&

!8

Youez - 2016 - github.com/yon3zu
LinuXploit