%PDF- %PDF-
Direktori : /snap/core/17212/usr/lib/python3/dist-packages/cloudinit/cmd/devel/__pycache__/ |
Current File : //snap/core/17212/usr/lib/python3/dist-packages/cloudinit/cmd/devel/__pycache__/logs.cpython-35.pyc |
"�T`J � @ s< d Z d d l Z d d l m Z d d l Z d d l Z d d l Z d d l m Z d d l m Z d d l m Z m Z d d l m Z m Z m Z m Z d d g Z d Z d Z d d d � Z d d � Z d d � Z d d � Z d d � Z d d d � Z d d � Z d d � Z e d k r8e j e � � d S)zGDefine 'collect-logs' utility and handler to include in cloud-init cmd.� N)�datetime)�INSTANCE_JSON_SENSITIVE_FILE)�tempdir)�ProcessExecutionError�subp)�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 s� | s t j d d d d � } | j d d d d d d d d d d �| j d d d d d d �| j d d d d d d d d d d j t � �| 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. �progzcollect-logsZdescriptionz)Collect and tar all cloud-init debug infoz --verbosez-v�action�count�defaultr �dest� verbosity�helpzBe more verbose.z --tarfilez-tzcloud-init.tar.gzzOThe tarfile to create containing all collected logs. Default: cloud-init.tar.gzz--include-userdataz-uF� store_true�userdatazPOptionally include user-data from {0} which could contain sensitive information.)�argparse�ArgumentParser�add_argument�format�USER_DATA_FILE)�parser� r �:/usr/lib/python3/dist-packages/cloudinit/cmd/devel/logs.py� get_parser s r c C s t j � d k r f St f S)z3Return a list of files to ignore if we are non-rootr )�os�getuidr )�curdir�filesr r r � _copytree_ignore_sensitive_files3 s r! c C s� y t | � \ } } WnL t k rd } z, t | t | � � t d | d | � WYd d } ~ Xn&