| Current Path : /lib/python3/dist-packages/uaclient/jobs/__pycache__/ |
| Current File : //lib/python3/dist-packages/uaclient/jobs/__pycache__/update_messaging.cpython-38.pyc |
U
8�-d� � @ s� d Z ddlZddlZddlZddlmZ ddlmZ ddlm Z m
Z
mZmZ ddl
mZ ddlmZ ddlmZmZ dd lmZ d
ZdZejG dd
� d
ej��Zed�dd�Zeeeef d�dd�Zeed�dd�Z dd� Z!dS )a%
Update messaging text for use in MOTD and APT custom Ubuntu Pro messages.
Messaging files will be emitted to /var/lib/ubuntu-advantage/message-* which
will be sourced by apt-hook/hook.cc and various /etc/update-motd.d/ hooks to
present updated text about Ubuntu Pro service and token state.
� N)�exists)�Tuple)�contract�defaults�messages�system)�_updates)�UAConfig)�ESMAppsEntitlement�ESMInfraEntitlement)�ApplicationStatuszmotd-contract-statusz6/usr/lib/update-notifier/update-motd-updates-availablec @ s e Zd ZdZdZdZdZdZdS )�ContractExpiryStatusr � � � � N)�__name__�
__module__�__qualname__�NONE�ACTIVE�ACTIVE_EXPIRED_SOON�EXPIRED_GRACE_PERIOD�EXPIRED� r r �@/usr/lib/python3/dist-packages/uaclient/jobs/update_messaging.pyr
s
r
)�cfgc C s� | j }|�dd�}|�di ��di ��dd �}t�| �}|�||�}|�di ��di ��dd �}|d k r�|| jjkr�||d d d<