Server IP : 23.254.227.96 / Your IP : 216.73.216.7 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/devel/__pycache__/ |
Upload File : |
3 ��b� � @ s� d Z ddlZddlZddlZddlZddlmZ ddlmZ ddlm Z m Z ddlmZ ddl mZmZmZmZ dd gZd ZdZddd �Zdd� Zdd� Zdd� Zdd� Zddd�Zdd� Zdd� Zedkr�eje� � dS )zGDefine 'collect-logs' utility and handler to include in cloud-init cmd.� N)�datetime)�INSTANCE_JSON_SENSITIVE_FILE)�ProcessExecutionError�subp)�tempdir)�chdir�copy� ensure_dir� write_filez/var/log/cloud-init.logz/var/log/cloud-init-output.logz/run/cloud-initz%/var/lib/cloud/instance/user-data.txtc C sZ | st jddd�} | jdddddd d � | jddd dd� | jddddddjt�d� | S )a2 Build or extend and arg parser for collect-logs utility. @param parser: Optional existing ArgumentParser instance representing the collect-logs subcommand which will be extended to support the args of this utility. @returns: ArgumentParser with proper argument configuration. zcollect-logsz)Collect and tar all cloud-init debug info)�prog�descriptionz --verbosez-v�countr � verbosityzBe more verbose.)�action�default�dest�helpz --tarfilez-tzcloud-init.tar.gzzOThe tarfile to create containing all collected logs. Default: cloud-init.tar.gz)r r z--include-userdataz-uF� store_true�userdatazPOptionally include user-data from {0} which could contain sensitive information.)r r r r )�argparse�ArgumentParser�add_argument�format�USER_DATA_FILE)�parser� r �/usr/lib/python3.6/logs.py� get_parser s2 r c C s dg}t j� dkr|jt� |S )z>Return a list of files to ignore for /run/cloud-init directoryzhook-hotplug-cmdr )�os�getuid�appendr )�curdir�filesZ ignored_filesr r r �_copytree_rundir_ignore_filesD s r# c C st yt | �\}}W n@ tk rP } z$t|t|�� td| d|� W Y dd}~X n X t||� td| d|� |S dS )zCHelper which runs a command and writes output or error to filename.zcollecting %s failed. � Nz collected %s )r r r �str�_debug)�cmd�filename�msgr �out�_�er r r �_write_command_output_to_fileO s " r- c C s ||krt jj| � d S )N)�sys�stderr�write)r) �levelr r r r r&