+
     g                         R t ^ RIt^ RIt^ RIHt ^ RIHtHtHtH	t	H
t
 ^ RIHt ^ RIHt ^ RIHtHt ^ RIHt ^ RIHtHt R	tR
t]P4                  ! ]
P6                  ! ]4      4      tR R ltR R ltR t R# )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)contractdefaultsmessagessystemutil)_updates)_enabled_services)ContractExpiryStatus_is_attachedUAConfig)machine_tokennoticeszmotd-contract-statusz6/usr/lib/update-notifier/update-motd-updates-availablec                $    V ^8  d   QhR\         /# )   cfgr   )formats   "A/usr/lib/python3/dist-packages/uaclient/timer/update_messaging.py__annotate__r       s     - - -    c                    \         P                  ! V 4      pVP                   pVP                  R / 4      P                  R/ 4      P                  RR4      p\        P                  ! V 4      pVP                  VP                  RR4      V4      pVP                  R / 4      P                  R/ 4      P                  RR4      pVe9   WaP                  8w  d'   VVR ,          R,          R&   VP                  V4       R# R# R# )machineTokenInfocontractInfoidNmachineToken effectiveTo)r   get_machine_token_filegetr   UAContractClientget_contract_machinecontract_expiry_datetimewrite)r   machine_token_file
orig_tokencontract_idcontract_clientrespresp_expirys   &      r   update_contract_expiryr*       s    &==cB#11J)2.	^R	 	T4 
 //4O//~r*KD 	#R(	^R	 	]D	!  	FFF  	%&~6	
 	  , G 	 r   c                0    V ^8  d   QhR\         R\        /# )r   r   return)r   bool)r   s   "r   r   r   ;   s     f fh f4 fr   c                	   \        V 4      pVP                  '       g   R# \        P                  R4       \        P
                  P                  V P                  R\        4      pVP                  pVP                  p\        P                  ! V 4      pV\        P                  P                  \        P                   P                  \        P"                  P                  39   d/   \%        V 4       \        V 4      pVP                  pVP                  pV\        P&                  P                  \        P(                  P                  39   dG   \*        P,                  ! \*        P.                  P0                  4       \2        P4                  ! V4       R# V\        P                  P                  8X  d|   \*        P,                  ! \*        P.                  P0                  4       \2        P6                  ! V\8        P:                  P=                  V4      P?                  VR7      R,           4       R# V\        P                   P                  8X  d   \*        P,                  ! \*        P.                  P0                  4       \@        PB                  V,           pVPD                  pVf   RpMVPG                  R4      p\2        P6                  ! V\8        PH                  P=                  V4      P?                  VVR7      R,           4       R# V\        P"                  P                  8X  Edh   \*        PJ                  ! \*        P.                  P0                  4       R	p	^ p
\M        V 4      PN                   Uu0 uF  qPP                  kK  	  pp\2        PR                  ! 4       '       d*   R
V9   d"   R
p	\U        V 4      PV                  PX                  p
MC\2        PZ                  ! 4       '       d)   RV9   d"   Rp	\U        V 4      PV                  P\                  p
V
^ 8X  d/   \2        P6                  ! V\8        P0                  R,           4       R# \2        P6                  ! V\8        P^                  P=                  V
4      P?                  V
V	R7      R,           4       R# u upi )zEmit human-readable status message used by motd.

Used by /etc/update.motd.d/91-contract-ua-esm-status

:param cfg: UAConfig instance for this environment.
Fz&Updating Ubuntu Pro messages for MOTD.r   )remaining_daysz

Unknownz%d %b %Y)expired_dater/   zn/az	esm-infrazesm-apps)pkg_numserviceT)0r   is_attachedLOGinfoospathjoindata_dirMOTD_CONTRACT_STATUS_FILE_NAMEcontract_statuscontract_remaining_daysr   r   r
   ACTIVE_EXPIRED_SOONvalueEXPIRED_GRACE_PERIODEXPIREDr*   ACTIVENONEr   removeNoticeCONTRACT_EXPIREDr   ensure_file_absent
write_filer   CONTRACT_EXPIRES_SOON	pluralizer   r   !CONTRACT_EXPIRY_GRACE_PERIOD_DAYSr"   strftimeCONTRACT_EXPIRED_GRACE_PERIODaddr	   enabled_servicesnameis_current_series_active_esmapi_u_pro_packages_updates_v1summarynum_esm_infra_updatesis_current_series_ltsnum_esm_apps_updatesCONTRACT_EXPIRED_WITH_PKGS)r   is_attached_infomotd_contract_status_msg_pathexpiry_statusr/   r$   grace_period_remainingexp_dt
exp_dt_strr3   r2   senabled_services_namess   &            r   update_motd_messagesr`   ;   s    $C('''HH56$&GGLLj"@%! %44M%==N&==cB00661177$$** 
 	s#',(88)AA##))!!''  	w~~667!!"?@F E 
.BBHH	Hw~~667)**44^DKK- L  	
@ s 
.CCII	Iw~~66766G 	 $<<>"J4J)22<<f'5   		
^ K 
.66<<	<GNN334 .c2CC"
CqFFC 	 "
 ..0044%7'//  ))++33$7'..  a<-))F2  -33==gFMM## N  	 ?"
s   *R
c                      \        \        4      '       d     \        P                  ! \        R .4       R# R#   \         d!   p \
        P                  T 4        Rp ? R# Rp ? ii ; i)z--forceN)r   UPDATE_NOTIFIER_MOTD_SCRIPTr   subp	Exceptionr5   	exception)excs    r   refresh_motdrg      sM     )**	KK4i@A +  	MM#	s   7 A"AA")!__doc__loggingr7   os.pathr   uaclientr   r   r   r   r   &uaclient.api.u.pro.packages.updates.v1r   rR   -uaclient.api.u.pro.status.enabled_services.v1r	   (uaclient.api.u.pro.status.is_attached.v1r
   r   uaclient.configr   uaclient.filesr   r   r;   rb   	getLoggerreplace_top_level_logger_name__name__r5   r*   r`   rg    r   r   <module>ru      so     	  ? ? L % 1!7 <  ::8DE-6fR
r   