o
    ϴf                     @   s   d dl Z d dlZd dlmZ d dlmZmZmZ d dlm	Z	 d dl
mZ e eeZejeddZdd	 Zd
d Zde	fddZdS )    N)TimeoutExpired)
exceptionssystemutil)UAConfig)DEFAULT_DATA_DIRmessageszmotd-auto-attach-statusc               
   C   T   zt jg ddd W d S  tjtfy) }  ztj| | d W Y d } ~ d S d } ~ ww )N)	systemctlstartubuntu-advantage.service       @timeoutexc_infor   subpr   ProcessExecutionErrorr   LOGwarninge r   :/usr/lib/python3/dist-packages/uaclient/daemon/__init__.pyr         r   c               
   C   r	   )N)r
   stopr   r   r   r   r   r   r   r   r   r      r   r   cfgc                 C   s   ddl m} ||  d S )Nr   )retry_auto_attach)uaclient.daemonr   cleanup)r   r   r   r   r   r    "   s   r    )loggingos
subprocessr   uaclientr   r   r   uaclient.configr   uaclient.defaultsr   	getLoggerreplace_top_level_logger_name__name__r   pathjoinAUTO_ATTACH_STATUS_MOTD_FILEr   r   r    r   r   r   r   <module>   s    		