+
    gh                        ^ RI Ht ^ RIHtHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RI
HtHtHtHtHt ^ RIt^ RIHtHtHtHt ^ R	IH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#H$t$ ^ RI%H&t&H't'H(t( ^ RI)H*t*H+t+H,t,H-t-H.t. R4t/ ! R R]4      t0R t1]! RR7      R 4       t2R R lt3R R lt4]! RR7      R R l4       t5R R lt6R R lt7R R  lt8R! R" lt9R# R$ lt:R% R& lt;R5R' R( llt<R) t=R* t>R+ R, lt?R- t@R. R/ ltAR0 tBR1 tCR2 tDR3 tER# )6    )defaultdict)datetimetimezone)Enum)	lru_cache)choice)AnyDefaultDictDictListTupleN)
exceptions	livepatchmessagesutil)_reboot_required)_is_attached)PreserveAptCfgget_apt_cache_datetimeget_apt_pkg_cacheget_esm_apt_pkg_cacheget_pkg_candidate_versionUAConfig)ESMAppsEntitlementESMInfraEntitlement)ApplicabilityStatusApplicationStatusContractStatus)get_distro_infoget_kernel_infoget_release_infois_current_series_ltsis_supportedc                   .    ] tR t^(tRtRtRtRtRtRt	Rt
R# )	UpdateStatusz2Represents the availability of a security package.upgrade_availableupgrade_available_not_preferredpending_attachpending_enableupgrade_unavailable N)__name__
__module____qualname____firstlineno____doc__	AVAILABLEAVAILABLE_NOT_PREFERRED
UNATTACHEDNOT_ENABLEDUNAVAILABLE__static_attributes__r,       :/usr/lib/python3/dist-packages/uaclient/security_status.pyr&   r&   (   s    8#I?!J"K'Kr8   r&   c                 D    \        \        P                  ! V 4      4       R # )N)printr   create_package_list_str)packagess   &r9   print_package_listr>   1   s    	$
&
&x
01r8   )maxsizec                      \        4       P                  p R RP                  V 4      3RRRP                  V 4      3RRRP                  V 4      3RRR	P                  V 4      3RRR
P                  V 4      3R/# )Ubuntuz{}-securitystandard-securityUbuntuESMAppsz{}-apps-securityesm-apps	UbuntuESMz{}-infra-security	esm-infraz{}-apps-updatesz{}-infra-updates)r"   seriesformat)rG   s    r9   %get_origin_information_to_service_maprI   5   s    &&F	=''/02E	,33F;<j	)0089;	+226:;Z	(//78+ r8   c                h    V ^8  d   QhR\         R\        \        P                  ,          3,          /# )   returnstr)r
   r   apt_pkgPackage)rH   s   "r9   __annotate__rP   A   s'      tGOO,,-r8   c                  z   \        \        4      p \        \        4      ;_uu_ 4       pVP                   Uu. uF  q"P
                  '       g   K  VNK  	  ppW0R &   \        P                  ! V4      pV F$  pV \        W$4      ,          P                  V4       K&  	  RRR4       V # u upi   + '       g   i     T # ; i)allN)
r   listr   r   r=   current_verrN   DepCache get_origin_for_installed_packageappend)resultcachepackageinstalled_packages	dep_caches        r9    get_installed_packages_by_originr]   A   s     F	)	*	*e#(>>
#15H5HGG> 	 
 +u$$U+	)G0DfWo * 
+ M
 
+	* Ms#   B)B$B$AB)$B))B:	c                d    V ^8  d   QhR\         P                  R\         P                  R\        /# )rK   rZ   r\   rL   )rN   rO   rU   rM   )rH   s   "r9   rP   rP   V   s.     " "__")0)9)9""r8   c                   V P                   '       g   R# V P                   P                  p\        V4      ^8X  d9   VP                  V 4      pV'       d   V P                   V8X  d   R# VP                  pV Fc  w  rE\	        4       P                  VP                  VP                  3R4      pV\        9   d   Vu # VP                  R8X  g   KW  VP                  u # 	  R# )z
Returns the origin for a package installed in the system.

Technically speaking, packages don't have origins - their versions do.
We check the available versions (installed, candidate) to determine the
most reasonable origin for the package.
 unknownrA   third-party)
rT   	file_listlenget_candidate_verrI   getoriginarchiveESM_SERVICES	component)rZ   r\   available_origins	candidaterg   _services   &&     r9   rV   rV   V   s     ++55 "//8	G//9<%//&	79==]]FNN+R
 l"N==H$### ' r8   c                <    V ^8  d   QhR\         R\         R\        /# )rK   pkgversionrL   )rM   bool)rH   s   "r9   rP   rP   |   s!      s S T r8   c                8    \        V RR7      pV'       d   W8H  # R# )z;Returns True if the package version is a candidate version.F)check_esm_cache)r   )rp   rq   candidate_versions   && r9   _is_candidate_versionrv   {   s      2#uM++r8   c                ~    V ^8  d   QhR\         R\        \         \        3,          R\        P                  R\         /# )rK   service_nameua_inforq   rL   )rM   r   r	   rN   Version)rH   s   "r9   rP   rP      s<     * **#s(^* __* 		*r8   c                   V R9   g   VR,          '       dt   WR,          9   dg   \        VP                  P                  VP                  4      pV'       d   \        P
                  P                  # \        P                  P                  # VR,          '       g   \        P                  P                  # WR,          9   d   \        P                  P                  # \        P                  P                  # )zDefines the update status for a package based on the service name.

For ESM-[Infra|Apps] packages, first checks if Pro is attached. If this is
the case, also check for availability of the service.
attachedenabled_servicesentitled_services)rB   standard-updates)rv   
parent_pkgnamever_strr&   r2   valuer3   r4   r5   r6   )rx   ry   rq   is_candidates   &&& r9   get_update_statusr      s     @@
8J0K K,##W__

  ""((	
 55;;	

 :&&,,,233''---##)))r8   c          	          V ^8  d   QhR\         \        P                  ,          R\        \        \         \
        \        P                  \        3,          ,          3,          /# )rK   r=   rL   )r   rN   rO   r
   rM   r   rz   )rH   s   "r9   rP   rP      sB     = =7??#=d5#!56778=r8   c           	     (   \        \        4      p\        \        4      ;_uu_ 4       pV  EF  pVP                  '       g   K  VP
                   F  pWCP                  8  g   K  RpVP                   Fb  w  rg\        4       P                  VP                  VP                  34      pV'       g   K>  W,          P                  WFP                  34       Rp M	  VP                  ^ ,          ^ ,          p	V'       d   K  RV	P                  9  g   K  VR,          P                  WIP                  34       K  	  VP                  V9   g   EK  W#P                  ,          p
V
P
                   F  pWCP                  8  g   K  VP                   Fa  w  rg\        4       P                  VP                  VP                  34      pV'       g   K>  W,          P                  WFP                  34        K  	  K  	  EK  	  RRR4       V#   + '       g   i     T# ; i)zFilters a list of packages looking for available updates.

All versions greater than the installed one are reported, based on where
it is provided, including ESM pockets, excluding backports.
FT	backportsr   N)r   rS   r   r   rT   version_listrc   rI   rf   rg   rh   rW   siter   )r=   rX   	esm_cacherZ   rq   counted_as_securityrg   rm   rn   expected_originesm_packages   &          r9   filter_updatesr      s    F 
-	.	.)G"""&33G!4!44.3+)0):):IF E G K K%+]]FNN$C!" $
  'w & 6 67M N6: 3 % *; +2*;*;A*>q*A 3 3 +?3J3J J"#56==!(*>*> ?+  48 <<9,"+LL"9K#.#;#;"%8%88-4->->	*O*Q*U*U%+]]FNN$C+" $+7$*O$:$:)0++(>%& %* .? $<C   
/\ M] 
/	.\ Ms>   H H #AH /AH ;H 5H 	.H <AH 0H  H	c                R    V ^8  d   QhR\         R\        \        \        3,          /# rK   cfgrL   r   r   rM   r	   )rH   s   "r9   rP   rP      s"      X $sCx. r8   c                r   \        V 4      P                  pRVR. R. /pV'       Ed   \        V 4      p\        V 4      pVP	                  4       \
        P                  8X  d   VR,          P                  R4       VP                  4       ^ ,          \        P                  8X  d   VR,          P                  R4       VP	                  4       \
        P                  8X  d   VR,          P                  R4       VP                  4       ^ ,          \        P                  8X  d   VR,          P                  R4       V# )z7Returns the Pro information based on the config object.r|   r}   r~   rD   rF   )r   is_attachedr   r   contract_statusr   ENTITLEDrW   application_statusr   ENABLED)r   r   ry   infra_entitlementapps_entitlements   &    r9   get_ua_infor      s
   s#//KKBRG {/4-c2++-1H1HH'(//
;//1!4 (() &'..z:,,..2I2II'(//<00215 (() &'..{;Nr8   c                \    V ^8  d   QhR\         \        \        \        3,          ,          /# )rK   rL   )r   r   rM   r	   )rH   s   "r9   rP   rP     s       $tCH~"6 r8   c                  <    \         P                  ! 4       p \	        4       P
                  pT e   Te   YP                  8X  d   T P                   e   T P                   P                  R8X  d   T P                   P                  ew   \        T P                   P                  4      ^ 8  dS   T P                   P                   Uu. uF1  pRTP                  ;'       g    RRTP                  ;'       g    R/NK3  	  up# . #   \        P                   d    . u # i ; iu upi )Nappliedr   r`   patchedF)r   statusr   ProcessExecutionErrorr!   proc_version_signature_versionkernelstatefixesrd   r   r   )	lp_statusour_kernel_versionfixs      r9   get_livepatch_fixed_cvesr     s    $$&	 )*II*"2"22+%%2%%1	##))*Q. !**00
0 SXX^^Y0D0DuE0
 	

 I% ++ 	
s#   C<  DD/D<DDc          	         V ^8  d   QhR\         \        \        \        \        P
                  \        3,          ,          3,          R\        \        \        3,          R\        \        \        \        3,          ,          /# )rK   upgradable_versionsry   rL   )r
   rM   r   r   rN   rz   r   r	   )rH   s   "r9   rP   rP     sX      $S$uW__c5I/J*K%KL#s(^ 
$sCx.r8   c                     . pV P                  4        Fa  w  r4V FV  w  rV\        W1V4      pVP                  R VP                  P                  RVP
                  RVRVRVRVP                  /4       KX  	  Kc  	  V# )rZ   rq   rx   r   rg   download_size)itemsr   rW   r   r   r   size)r   ry   updatesrn   r   rq   rg   r   s   &&      r9   create_updates_listr     s     G!4!:!:!<+OG&wAFNNw1166w"Gff#W\\	  , "= Nr8   c                R    V ^8  d   QhR\         R\        \        \        3,          /# r   r   )rH   s   "r9   rP   rP   /  s"     / /h /4S> /r8   c           
        \        V 4      pRV/p\        4       pVR,          p\        V4      VR&   \        V4      p. VR&   \	        WQ4      p\        VR,          4      VR&   \        VR,          4      VR&   \        VR	,          4      VR
&   \        VR,          4      VR&   \        VR,          4      VR&   \        VR,          4      VR&   \        VR,          4      VR&   \        VR,          4      VR&   \        VR,          4      VR&   \        VR,          4      VR&   \        VR,          4      VR&   \        V 4      P                  VR&   RRRVRVRR\        4       //# ) aO  Returns the status of security updates on a system.

The returned dict has a 'packages' key with a list of all installed
packages which can receive security updates, with or without ESM,
reflecting the availability of the update based on the Pro status.

There is also a summary with the Ubuntu Pro information and the package
counts.
uarR   num_installed_packagesr   mainnum_main_packages
restrictednum_restricted_packagesuniversenum_universe_packages
multiversenum_multiverse_packagesrb   num_third_party_packagesra   num_unknown_packagesrF   num_esm_infra_packagesrD   num_esm_apps_packagesnum_esm_infra_updatesnum_esm_apps_updatesrB   num_standard_security_updatesreboot_required_schema_versionz0.1summaryr=   r   
fixed_cves)r   r]   rd   r   r   r   r   r   )r   ry   r   packages_by_originr[   r   r   s   &      r9   security_status_dictr   /  s    #GWoG9;+E2(+,>(?G$%();<.0*+!"5?G#&'9&'A#BG ),-?-M)NG%&'*+=j+I'JG#$),-?-M)NG%&*-=)+G&' '**<Y*G&HG"#(+,>{,K(LG$%'*+=j+I'JG#$'*+>{+K'LG#$&)*=j*I&JG"#/2/00G+, "2#!6!F!FG 	57Gl$<$>?	 r8   c                    V ^8  d   QhR\         \        \        \        P                  ,          3,          R\        R\
        RR/# )rK   package_lists
show_itemsalways_showrL   N)r
   rM   r   rN   rO   rr   )rH   s   "r9   rP   rP   a  sC     < <sD$99:<< < 
	<r8   c                    \        V R ,          4      p\        \        P                  P	                  VR7      4       R\        \        V4      4      ^,           ,          pVR9   d{   \        V R,          4      \        V R,          4      ,           \        V R,          4      ,           p\        \        P                  P                  V4      P	                  VVRR7      4       VR9   d   \        V R	,          4      \        V R
,          4      ,           \        V R,          4      ,           pV'       g	   V'       d;   \        \        P                  P                  V4      P	                  VVRR7      4       VR9   d[   \        V R,          4      pV'       g	   V'       d9   \        \        P                  P                  V4      P	                  WGR7      4       VR9   d\   \        V R,          4      pV'       g	   V'       d:   \        \        P                  P                  V4      P	                  VVR7      4       \        R4       R# )rR   )count rF   r   r   Main/Restricted)offsetr   
repositoryrD   r   r   Universe/Multiverserb   )r   r   ra   r`   N)rR   rF   )rR   rD   )rR   rb   )rR   ra   )
rd   r;   r   SS_SUMMARY_TOTALrH   rM   SS_SUMMARY_ARCHIVE	pluralizeSS_SUMMARY_THIRD_PARTYSS_SUMMARY_UNAVAILABLE)	r   r   r   total_packagesr   packages_mrpackages_umpackages_thirdpartypackages_unknowns	   &&&      r9   _print_package_summaryr   a  s   
 u-.N	(
#
#
*
*
*
@ACN+,q01F))f%&--./-,-. 	
 	''11+>EE!, F 	
 ((j)*--./-
+,- 	
 +++55kBII!%4 J  ++!-">?+//99'&&B ''}Y78{//99$&!*   
"Ir8   c                  0   \        4       P                  p \        V 4      P                  pR P	                  \        VP                  4      \        VP                  4      4      p\        \        P                  P	                  VR7      4       \        R4       R# )z{}/{}dater`   N)r"   rG   r    eolrH   rM   monthyearr;   r   SS_INTERIM_SUPPORT)rG   eol_dater   s      r9   _print_interim_release_supportr     se    &&Fv&**H>>#hnn-s8==/ABD	(
%
%
,
,$
,
78	"Ir8   c                  (   \        4       P                  p \        V 4      '       dT   \        V 4      P                  p\        \        P                  P                  \        VP                  4      R 7      4       R# \        \        P                  4       R# )r   N)r"   rG   r$   r    r   r;   r   SS_LTS_SUPPORTrH   rM   r   SS_NO_SECURITY_COVERAGE)rG   r   s     r9   _print_lts_supportr     s^    &&FF"6*..h%%,,#hmm2D,EFh../r8   c                l    V ^8  d   QhR\         R\         R\        R\        R\        R\        R\        /# )rK   rn   r   service_statusservice_applicabilityinstalled_updatesavailable_updatesr   )rM   r   r   intrr   )rH   s   "r9   rP   rP     sN     / /// &/ /	/
 / / /r8   c                 d   \        4       P                  p\        V4      P                  pV\        P
                  8X  d7   \        P                  P                  VV \        VP                  4      R 7      p	M5\        P                  P                  V V\        VP                  4      R7      p	V'       d>   V	R\        P                  P                  V4      P                  VR7      ,           ,          p	V'       d>   V	R\        P                  P                  V4      P                  VR7      ,           ,          p	\        V	4       V'       d_   V\        P                   8X  dJ   V\"        P$                  8X  d5   \        R4       \        \        P&                  P                  V R7      4       \        R4       R# ))r   rn   r   )rn   r   r   r   )r   r`   rn   N)r"   rG   r    eol_esmr   r   r   SS_SERVICE_ENABLEDrH   rM   r   SS_SERVICE_ADVERTISESS_SERVICE_ENABLED_COUNTSr   SS_SERVICE_ADVERTISE_COUNTSr;   DISABLEDr   
APPLICABLESS_SERVICE_COMMAND)
rn   r   r   r   r   r   r   rG   eol_date_esmmessages
   &&&&&&&   r9   _print_service_supportr    sc    &&F"6*22L*222--44!\&&' 5 
 //66!\&&' 7 
 3;;EE

&%  

 	
 3==GG

&%  

 	

 
'N 	/888!%8%C%CCb	h))000AB	"Ir8   c                  h   \        4       p V f'   \        \        P                  4       \        R4       R # \        P
                  ! \        P                  4      pW,
          pVP                  ^ 8  dA   \        \        P                  P                  VP                  R7      4       \        R4       R # R # )Nr`   )days)r   r;   r   SS_UPDATE_UNKNOWNr   nowr   utcr  SS_UPDATE_DAYSrH   )last_apt_updater  time_since_updates      r9   _print_apt_update_callr
    s    ,.Oh(()b	
,,x||
$C-!h%%,,2C2H2H,IJb	 "r8   c                $    V ^8  d   QhR\         /# )rK   r   r   )rH   s   "r9   rP   rP     s     J& J& J&r8   c           
      6   \        V 4      p\        V 4      pVP                  4       ^ ,          pVP                  4       ^ ,          pVP                  4       ^ ,          pVP                  4       ^ ,          p\	        4       P
                  p\        4       p\        V 4      R,          p	\        4       p
\        V
R,          V
R,          ,           V
R,          ,           4      R,          p\        V
R,          V
R,          ,           V
R,          ,           4      R,          p\        V
4       \        \        P                  4       \        R4       \        4        V'       g7   \        V4      '       d   \!        4        \        \        P"                  4       R	# V\$        P&                  8X  d   \)        4        V	'       d   \        \        P*                  4       M\        \        P,                  4       \        R4       \/        RR
VV\1        V
R,          4      \1        V4      V	R7       V
R,          '       g   V
R,          '       g   V
R,          '       d,   \/        RRVV\1        V
R,          4      \1        V4      V	R7       V	'       g   \        \        P2                  4       R	# R	# )r   r|   r   r   rF   r   r   rD   r`   Nr   rn   r   r   r   r   r   r   r   )r   r   r   applicability_statusr"   rG   r#   r   r]   r   r   r;   r   SS_HELP_CALLr
  r$   r   SS_NO_INTERIM_PRO_SUPPORTr   r   r   SS_IS_ATTACHEDSS_IS_NOT_ATTACHEDr  rd   SS_LEARN_MORE)r   esm_infra_entesm_apps_entesm_infra_statusesm_infra_applicabilityesm_apps_statusesm_apps_applicabilityrG   is_ltsr   r   "security_upgradable_versions_infra!security_upgradable_versions_appss   &            r9   security_statusr    s    ',M%c*L$779!<+@@B1E"557:O)>>@C&&F"$Fc":.K9;)76"
\
*	+
[
)	** 	*& )7:&
\
*	+
Z
(	)) 	)% -.	(

 	"I*,h001,555h%%&h))*	"I$'50=>@A 	:&&l++j)),*"8!"4Z"@A!"CD#	
 h$$% r8   c                     \        4       p V R ,          pV Uu. uF  q"P                  NK  	  pp\        V R RR7       V'       d}   \        \        P
                  4       \        R4       \        \        P                  4       \        V4       \        \        P                  P                  \        V4      R7      4       R# \        \        P                  4       R# u upi )rb   Tr   r   r`   rZ   N)r]   r   r   r;   r   SS_THIRD_PARTYSS_PACKAGES_HEADERr>   SS_SHOW_HINTrH   r   SS_NO_THIRD_PARTY)r   third_party_packagesrZ   package_namess       r9   list_third_party_packagesr'  >  s    9;-m<1EF1Eg\\1EMF}$ h%%&b	h))*=)h##**6-3H*IJh(() G   Cc                     \        4       p V R ,          pV Uu. uF  q"P                  NK  	  pp\        V R RR7       V'       d}   \        \        P
                  4       \        R4       \        \        P                  4       \        V4       \        \        P                  P                  \        V4      R7      4       R# \        \        P                  4       R# u upi )ra   Tr  r`   r   N)r]   r   r   r;   r   SS_UNAVAILABLEr"  r>   r#  rH   r   SS_NO_UNAVAILABLE)r   unknown_packagesrZ   r&  s       r9   list_unavailable_packagesr-  R  s    9;))41AB1Ag\\1AMByd h%%&b	h))*=)h##**6-3H*IJ 	h(() Cr(  c           
         \        4       pVR ,          pVR,          VR,          ,           pW#,           p\        4       p\        V4      R ,          pV F   w  rxVP                  VP                  4       K"  	  \        4       P                  p	\        4       p
\        V 4      p\        V 4      pVP                  4       ^ ,          pVP                  4       ^ ,          p\        V Uu. uF  qP                  NK  	  up4      p\        V Uu. uF  qP                  NK  	  up4      p\        V Uu. uF5  pVP                  V9  g   K  VP                  V9  g   K)  VP                  NK7  	  up4      p\        VR RR7       V
'       g7   \        V	4      '       d   \!        4        \#        \$        P&                  4       R# V\(        P*                  8X  d   \-        4        \#        R4       \/        R RVV\1        V4      \1        V4      RR	7       \#        \$        P2                  P5                  R R
7      4       \#        R4       \        V	4      '       Eg*   V'       d5   \#        \$        P6                  P5                  R R
7      4       \9        V4       V'       d5   \#        \$        P:                  P5                  R R
7      4       \9        V4       T;'       g    TpV'       d`   V'       d"   \$        P<                  P5                  R R
7      pM \$        P>                  P5                  R R
7      p\#        V4       \9        V4       V'       d5   \#        \$        P@                  P5                  \C        V4      R7      4       R# R# R# u upi u upi u upi )rF   r   r   Tr  Nr`   r   Fr  r   r   )"r]   setr   addr   r"   rG   r#   r   r   r   r  sortedr   r   r$   r   r;   r   r  r   r   r   r  rd   SS_SERVICE_HELPrH   SS_UPDATES_AVAILABLEr>   SS_UPDATES_INSTALLEDSS_FURTHER_OTHER_PACKAGESSS_OTHER_PACKAGESr#  r   )r   r   infra_packagesmr_packagesall_infra_packagesinfra_updatessecurity_upgradable_versionsupdaterm   rG   r  r  r  r  r  rZ   installed_package_namesavailable_package_namesremaining_package_names	hint_listmsgs   &                    r9   list_esm_infra_packagesrB  g  s   9;'4N$V,/A,/OOK'5EM#12D#E$  2	&++, 2 &&F"$F',M%c*L$779!<*??A!D$%34^'^4 %%23]']3 % .	
-||#::  $;; GLL-	
 { *,h001,555b	$'5n-m, 
(
"
"
)
)+
)
>?	"I"(//66{6KL67"(//66{6KL67+FF/F	"88??' @  00777L#J67(''..vi7H.IJ +  Q 	5 	4	
s    M5M:(M? M?M?c           
      .   \        4       pVR ,          pVR,          VR,          ,           pW#,           p\        4       p\        V4      R ,          pV F   w  rxVP                  VP                  4       K"  	  \        4       p	\        V 4      p
V
P                  4       ^ ,          pV
P                  4       ^ ,          p\        V Uu. uF  qP                  NK  	  up4      p\        V Uu. uF  qP                  NK  	  up4      p\        V Uu. uF5  pVP                  V9  g   K  VP                  V9  g   K)  VP                  NK7  	  up4      p\        VR RR7       V	'       g   \        \        P                  4       R# \        R RVV\!        V4      \!        V4      RR7       \        \        P"                  P%                  R R	7      4       \        R
4       V'       Ed*   V'       d5   \        \        P&                  P%                  R R	7      4       \)        V4       V'       d5   \        \        P*                  P%                  R R	7      4       \)        V4       T;'       g    TpV'       d`   V'       d"   \        P,                  P%                  R R	7      pM \        P.                  P%                  R R	7      p\        V4       \)        V4       V'       d5   \        \        P0                  P%                  \3        V4      R7      4       R# R# R# u upi u upi u upi )rD   r   r   Tr  Nr   Fr  r   r`   r   )r]   r/  r   r0  r   r#   r   r   r  r1  r   r   r;   r   r  r  rd   r2  rH   r3  r>   r4  r5  r6  r#  r   )r   r   apps_packagesum_packagesall_apps_packagesapps_updatesr;  r<  rm   r  r  r  r  rZ   r=  r>  r?  r@  rA  s   &                  r9   list_esm_apps_packagesrH    s   9;&z2M:&);L)II  &35L#12C#D$  2	**+ 2 #$F%c*L"557:O)>>@C$%23]']3 %%12\'\2 % -	
,||#::  $;; GLL,	
 zt h001(&4m,l+ 
(
"
"
)
)*
)
=>	"I"(//66z6JK67"(//66z6JK67+FF/F	 #88??& @  0077
7K#J67(''..vi7H.IJ - E 	4 	3	
s   L%L	L!L4L)rF   rD   )rR   F)Fcollectionsr   r   r   enumr   	functoolsr   randomr   typingr	   r
   r   r   r   rN   uaclientr   r   r   r   5uaclient.api.u.pro.security.status.reboot_required.v1r   (uaclient.api.u.pro.status.is_attached.v1r   uaclient.aptr   r   r   r   r   uaclient.configr   uaclient.entitlementsr   r   (uaclient.entitlements.entitlement_statusr   r   r   uaclient.systemr    r!   r"   r#   r$   ri   r&   r>   rI   r]   rV   rv   r   r   r   r   r   r   r   r   r   r  r
  r  r'  r-  rB  rH  r,   r8   r9   <module>rV     s   # '    6 6  : : B  % I 
  )(4 (2 4 *"J 4 *8=@B0,/d<~0/dJ&Z*(**VKrPKr8   