%PDF- %PDF-
Direktori : /snap/core/17212/usr/lib/python3/dist-packages/cloudinit/cmd/__pycache__/ |
Current File : //snap/core/17212/usr/lib/python3/dist-packages/cloudinit/cmd/__pycache__/status.cpython-35.pyc |
"�T`� � @ s� d Z d d l Z d d l Z d d l Z d d l m Z m Z m Z d d l m Z d d l m Z d d l m Z m Z m Z d Z d Z d Z d Z d Z d Z d d d � Z d d � Z d d � Z d d � Z d d � Z e d k r� e � d S)zFDefine 'status' utility and handler as part of cloud-init commandline.� N)�gmtime�strftime�sleep)�uses_systemd)�Init)�get_cmdline� load_file� load_jsonz/etc/cloud/cloud-init.disabledznot runZrunning�done�errorZdisabledc C sf | s t j d d d d � } | j d d d d d d d d �| j d d d d d d d 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. �prog�statusZdescriptionzReport run status of cloud initz-lz--long�action� store_true�defaultF�helpzJReport long format of statuses including run stage name and error messagesz-wz--waitz'Block waiting on cloud-init to complete)�argparse�ArgumentParser�add_argument)�parser� r �6/usr/lib/python3/dist-packages/cloudinit/cmd/status.py� get_parser s r c C s t d g � } | j � t | j � \ } } } | j r� xU | t t f k r� t j j d � t j j � t | j � \ } } } t d � q= Wt j j d � | j r� t d j | � � | r� t d j | � � t d j | � � n t d j | � � | t k rd Sd S) z4Handle calls to 'cloud-init status' as a subcommand.Zds_deps�.g �?� zstatus: {0}z time: {0}zdetail: {0}� r )r Zread_cfg�_get_status_details�paths�wait�STATUS_ENABLED_NOT_RUN�STATUS_RUNNING�sys�stdout�write�flushr Zlong�print�format�STATUS_ERROR)�name�argsZinitr � status_detail�timer r r �handle_status_args1 s"