+
    gr                        ^ RI t ^ RIt^ RIt^ RIt^ RIHt ^ RIHtHt ^ RIH	t	 ^ RI
HtHtHtHtHt ^ RIHtHt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 ^ R
I H!t!H"t" ^ RI#H$t$ ^ RI%H&t&H't'H(t(H)t) ^ RI*H+t+H,t,H-t-H.t. ^ RI/H0t0 ^ RI1H2t2 ]Pf                  ! 4       t4]Pj                  ! ]Pl                  ! ]74      4      t8Rt9Rt:Rt;])Px                  Pz                  ]2P|                  ]P~                  ,           ]2P                  ,           ])P                  Pz                  ]2P                  ]P                  ,           ]2P                  ,           ])P                  Pz                  ]2P                  ]P                  ,           ]2P                  ,           ])P                  Pz                  ]2P                  ]P                  ,           ]2P                  ,           ])P                  Pz                  ]2P                  ]P                  ,           ]2P                  ,           ]&P                  Pz                  ]2P|                  ]P                  ,           ]2P                  ,           ]&P                  Pz                  ]2P                  ]P                  ,           ]2P                  ,           ]9]2P|                  ]P                  ,           ]2P                  ,           ]:]2P|                  ]P                  ,           ]2P                  ,           ];]2P|                  ]P                  ,           ]2P                  ,           /
tSRtTRtURP                  ]P                  ]P                  ]P                  ]P                  R7      t[Rt\Rt]/ RRbRRbR]P                  ! 4       bRRbRR bR!RbR"RbR#RbR$. bR%](P                  Pz                  bR&]P                  bR'/ bR(. bR)R*R+R,R+R-R+R.. R/])P                  Pz                  /bR0R,R+R*R+R-R+R1. /bR2R bt`R3 taR4 R5 ltbR6 R7 ltcR8 R9 ltdR: R; lteRMR< R= lltfR> R? ltgRMR@ RA llthRB RC ltiRD RE ltjRNRF RG lltkRH RI ltlRMRJ RK lltmRL tnR# )O    N)OrderedDict)datetimetimezone)Enum)AnyDictListOptionalTuple)event_logger
exceptions	livepatchlockmessagesutilversion)_is_attached)UA_CONFIGURABLE_KEYSUAConfig)get_available_resourcesget_contract_information)ATTACH_FAIL_DATE_FORMATPRINT_WRAP_WIDTH)entitlement_factory)ContractStatusUserFacingAvailabilityUserFacingConfigStatusUserFacingStatus)machine_tokennoticesstate_filesuser_config_file)Notice)TxtColor	essentialstandardadvancedz({name: <17}{available: <11}{description}zJ{name: <17}{available: <11}{entitled: <11}{auto_enabled: <16}{description}z4{name: <17}{entitled: <10}{status: <13}{description})nameentitledstatusdescriptionz4{name: <17}{entitled: <19}{status: <22}{description}z={marker} {name: <15}{entitled: <19}{status: <22}{description}_doczUContent provided in json response is currently considered Experimental and may change_schema_versionz0.1r   
machine_idattachedF	effectiveexpiresoriginservicesexecution_statusexecution_detailsfeaturesr    contractid r(   
created_atproductstech_support_levelaccountexternal_account_ids	simulatedc           	      4   V P                  4        Uu. uFy  pR VP                  P                  '       g   VP                  P                  MVP                  P                  RVP
                  P                  RVP
                  P                  /NK{  	  up# u upi )r(   reason_codereason)blocking_incompatible_servicesentitlement
is_variantr(   variant_name	named_msgmsg)entservices   & 1/usr/lib/python3/dist-packages/uaclient/status.py_get_blocked_by_servicesrL      s     99; <G **555 ##((((557,,11g''++	
 <  s   !BABc                F    V ^8  d   QhR\         \        \        3,          /#    returnr   strr   )formats   "rK   __annotate__rT      s     8 8	#s(^8    c                 t   R pRpV P                  4       pV P                  4       pV P                  V9   d   RMRp/ pV\        P                  8X  d   \
        P                  p	MV P                  V9   d$   \
        P                  p	WP                  ,          pMV P                  4       w  rV	\
        P                  8X  d   RV
P                  RV
P                  /pMV
'       d   V
P                  pV	\
        P                  8X  d   RpV P                  '       dA   V P                  P                  4        UUu/ uF  w  rV\        V! VR7      VV4      bK  	  ppp\        V 4      pRV P                  RV P                   R	VP"                  R
V	P"                  RVRVRVRVRV/	pV P$                  '       g   WR&   V# u uppi )Nr9   noyescodemessage)cfgr(   r+   r)   r*   status_detailsdescription_override	available
blocked_bywarningvariants)status_description_overridecontract_statusr(   r   
UNENTITLEDr   UNAVAILABLEINAPPLICABLEuser_facing_statusWARNINGrH   ra   items_attached_service_statusrL   presentation_namer+   valuerE   )rI   inapplicable_resourcesr[   r`   r\   r]   rc   r^   ra   
ent_statusdetailsrF   variant_clsr_   service_statuss   &&&            rK   rj   rj      s    GN::<))+O$::IH.333%11
88--)66J#9((#C "%"8"8":J-555GLLw{{ !(-::: 	||| 69\\5G5G5I 6J1 !":#,.# 
 6J   *#.J 	%%sO))*"". 4Yj7
N >>>%-z"5s   2 F4c                R    V ^8  d   QhR\         R\        \        \        3,          /# rO   r[   rP   r   r   rR   r   )rS   s   "rK   rT   rT      s&     D D( DtCH~ DrU   c                   \         P                  ! \        P                  4       \         P                  ! \        P                  4       \        V 4      P                  '       d%   \         P                  ! \        P                  4       \        P                  ! \        4      p\        P                  ! V 4      pVP                  R,          pVR,          p\        P                  P                  pTP!                  RVR,          RRRVP#                  R4      R\         P$                  ! 4       ;'       g    . R	R
VR
,          RVR,          RVP#                  RR4      RVP#                  R. 4      RV/RRVP&                  R,          R
VP&                  R
,          RVP&                  P#                  RR4      RVP&                  P#                  R. 4      //4       VP#                  R4      '       d   VP(                  VR&   VP#                  R4      '       d   VR,          VR&   VP                  P#                  R4      pV'       g   \+        V 4      p\-        VR R7       Uu/ uF5  pVP#                  R4      '       d   K  VR,          VP#                  R4      bK7  	  ppV FB  p \/        WP#                  RR4      R7      p	TR,          P5                  \7        YT 4      4       KD  	  VR,          P9                  R R7       VP;                  4       P#                  R / 4      P#                  R!4      p
V
'       d5   V
P#                  R"/ 4      P#                  R#4      pV'       d   WR	,          R&   V# u upi   \0        P2                   d     K  i ; i)$z8Return configuration of attached status as a dictionary.machineTokenInfocontractInfor.   	machineIdr/   Tr2   r    r7   r8   r(   r:   	createdAtr9   r;   r<   r=   r>   externalAccountIDseffectiveTor1   effectiveFromr0   availableResourcesc                 &    V P                  R R4      # r(   r9   getxs   &rK   <lambda>"_attached_status.<locals>.<lambda>  s    fb8IrU   keyr^   r+   r[   r(   r3   c                 &    V P                  R R4      # r   r   r   s   &rK   r   r         AEE&",=rU   supportrD   affordancessupportLevel)r    remover#   AUTO_ATTACH_RETRY_FULL_NOTICEAUTO_ATTACH_RETRY_TOTAL_FAILUREr   is_attached_and_contract_validCONTRACT_EXPIREDcopydeepcopyDEFAULT_STATUSr   get_machine_token_filer   rf   rl   updater   listr=   contract_expiry_datetimer   sortedr   r   EntitlementNotFoundErrorappendrj   sortentitlements)r[   responsemachine_token_filerv   rw   r<   	resourcesresourcerm   rI   r   r   s   &           rK   _attached_statusr      s   NN6778NN699:C777v../}}^,H&==cB)778JK#N3L)66<<OO*;7l&&x0w||~++l4(V,l..{B?L,,Z<$&8 *226:(006088<<["M&(:(B(B(F(F(")		
. &&0II(( ,_ ="00445IJI+C0	 y.IJJH||K( 	6(,,}55J   	%#LL4LMC 	##$S#F	
  Z"=> 	'')--i<@@O  {{="599.I9EZ !56O1 22 		s   M'9M'M,,NNc                R    V ^8  d   QhR\         R\        \        \        3,          /# rs   rt   )rS   s   "rK   rT   rT     s"     + +H +c3h +rU   c                    \         P                  ! \        4      p\        V 4      pV EF  pVP	                  R4      '       d   \
        P                  P                  pM\
        P                  P                  p \        WP	                  RR4      R7      pTP                  R8X  dD   \        P                   ! 4       \        P"                  P$                  8X  d   TP'                  4       pMRpTR	,          P)                  RTP	                  R
TR,          4      RTP*                  RTRT/4       EK  	  VR	,          P-                  R R7       V#   \        P                   d,    \        P                  RTP	                  RR4      4        EKd  i ; i)z#Return unattached status as a dict.r^   r(   r9   r   z@Ignoring availability of unknown service %s from contract serverzwithout a 'name' keyr   Nr3   presentedAsr+   r]   c                 &    V P                  R R4      # r   r   r   s   &rK   r   $_unattached_status.<locals>.<lambda>G  r   rU   r   )r   r   r   r   r   r   	AVAILABLErl   re   r   r   r   LOGdebugr(   r   on_supported_kernelLivepatchSupportUNSUPPORTEDrb   r   r+   r   )r[   r   r   r   r^   rI   descr_overrides   &      rK   _unattached_statusr     sO    }}^,H',I<<$$.88>>I.::@@I		%#LL4LMC HH#--/))556 !<<>N!N##]HV4DEs&Y		
7 F Z"=>O; 22 	IIV%;<
 	s   9E;FFc                F    V ^8  d   QhR\         \        \        3,          /# rN   rQ   )rS   s   "rK   rT   rT   L  s     , ,tCH~ ,rU   c                n   \         pVP                  P                  p\        P                  p\
        P                  ! 4       w  rE\        P                  ! 4       ;'       g    . pV^ 8  d8   VP                  P                  p\        P                  P                  WER7      pMX\        P                  P                  '       d9   VP                  P                  pRp\        P                   P                  VR7      pRVRVRVRV P"                  RV P$                  R	V P&                  /p\(        P*                  P,                  P/                  4       p	\0         FS  p
\3        W
4      '       g   K  W,          e   K"  \5        W
4      p\7        V\8        4      '       d   VP                  pWV
&   KU  	  WR,          R
&   V# )a/  Return a dict with execution_status, execution_details and notices.

Values for execution_status will be one of UserFacingConfigStatus
enum:
    inactive, active, reboot-required
execution_details will provide more details about that state.
notices is a list of tuples with label and description items.
)pidlock_holderzconfiguration changes)	operationr4   r5   r    config_pathconfigr6   	ua_config)r   INACTIVErl   r   NO_ACTIVE_OPERATIONSr   check_lock_infor    r   ACTIVE	LOCK_HELDrS   r!   reboot_cmd_marker_file
is_presentREBOOTREQUIREDENABLE_REBOOT_REQUIRED_TMPLcfg_pathr[   r6   r"   user_configpublic_configto_dictr   hasattrgetattr
isinstancer   )r[   
userStatus
status_valstatus_desclock_pidr   notices_listr   retr   r   vals   &           rK   _get_config_statusr   L  sm    (J$$**J//K"224X<<>''RL!|&&,,
((// 0 
 
	+	+	6	6	6..44
+	::AA B 
 	J[<s||#''CLLC !,,::BBDI#3!7##C#t$$ii cN $ "+M+JrU   c                ^    V ^8  d   QhR\         R\        R\        \        \        3,          /# )rO   r[   show_allrP   )r   boolr   rR   r   )rS   s   "rK   rT   rT   {  s)       D T#s(^ rU   c                   \        V 4      P                  '       d   \        V 4      pM\        V 4      pVP	                  \        V 4      4       \        P                  ! 4       '       d    \        P                  P                  V4       V'       g?   VP                  R. 4       Uu. uF  pVP                  RR4      R8X  g   K  VNK   	  ppWBR&   V# u upi )zReturn status as a dict, using a cache for non-root users

When unattached, get available resources from the contract service
to report detailed availability of different resources for this
machine.

Write the status-cache when called by root.
r3   r^   rX   )r   is_attachedr   r   r   r   r   we_are_currently_rootr!   status_cache_filewriter   )r[   r   r   rJ   available_servicess   &&   rK   r*   r*   {  s     C$$$#C(%c*OO&s+,!!##%%++H5 $<<
B7
7{{;.%7 G7 	 

  2O
s   #CCc                    V ^8  d   QhR\         \        \        \        3,          ,          R\        R\        \        \        3,          /# )rO   r   entitlement_namerP   )r	   r   rR   r   )rS   s   "rK   rT   rT     s>     G GtCH~&G:=G	#s(^GrU   c           
        V  Fu  pVP                  R4      V8X  g   K  RVP                  R4      '       d   RMRRVP                  R/ 4      P                  R4      '       d   RMRRVP                  R/ 4      /u # 	  RRRRR/ /# )	z0Extract information from the entitlements array.typer)   rX   rW   auto_enabledobligationsenableByDefaultr   r   )r   r   rD   s   && rK   _get_entitlement_informationr     s     $??6"&66[__Z%@%@Ed"}b9==)   {}bA
 
 $ ndM2FFrU   c          	          V ^8  d   QhR\         R\        R\        \        \         \        3,          \
        3,          /# )rO   tokenr   rP   )rR   r   r   r   r   int)rS   s   "rK   rT   rT     s;     u uu#u
4S>3urU   c                
   ^ p\         P                  ! \        4      p \        W4      pTP                  R/ 4      pTP                  R/ 4      pTP                  RRTP                  RR4      R	TP                  R	R4      R
TP                  RR4      RTP                  R. 4      /RR	TP                  R	R4      RTP                  R4      R
TP                  RR4      RTP                  R. 4      /RR/4       \        P                  ! \        P                  4      p	TP                  R4      '       d   TP                  R4      TR&   TR,          p
Y,
          pTP                  4       ^ 8:  d   \         P"                  P%                  TR,          R,          T
P'                  \(        4      R7      p\*        P-                  TP.                  TP0                  R7       \*        P3                  \         P4                  R,           TP.                  ,           R,           4       ^pTP                  R4      '       d   TP                  R4      TR&   TR,          pY,
          pTP                  4       ^ 8:  d   \         P6                  P%                  TR,          R,          TP'                  \(        4      R7      p\*        P-                  TP.                  TP0                  R7       \*        P3                  \         P4                  R,           TP.                  ,           R,           4       ^p\9        T 4      p\;        TR R7       Uu. uF  pTR,          '       d   K  TR	,          NK  	  ppTP                  R. 4      pT F  pTP                  R	R4      p \=        T TR7      p\A        TT4      pTR,          PC                  R	TP                  RTP0                  4      R TPD                  R!TR!,          R"TR",          RTP0                  T9  d   R#MR$/4       K  	  TR,          PG                  R% R7       \A        TR&4      pTR!,          '       d-   TR',          P                  R(4      pT'       d   TTR,          R)&   TP                  \I        T 4      4       T'       g@   TP                  R. 4       Uu. uF  pTP                  RR#4      R#8X  g   K  TNK   	  ppTTR&   YC3#   \        P
                   d@   p\        TR4      '       d'   TP                  R8X  d   \        P                  ! 4       hThRp?ii ; iu upi   \        P>                   d     EK  i ; iu upi )*zGet a status dictionary based on a token.

Returns a tuple with the status dictionary and an integer value - 0 for
success, 1 for failure
rY   i  Nrw   accountInfor7   r8   r9   r(   r:   ry   r;   r=   r>   rz   r?   Tr{   r1   )contract_iddate)	error_msg
error_code
r|   r0   c                     V R ,          # r(    r   s   &rK   r   !simulate_status.<locals>.<lambda>  s    &	rU   r   r^   resourceEntitlementsr   r3   r   r+   r)   r   rX   rW   c                 &    V P                  R R4      # r   r   r   s   &rK   r   r     r   rU   r   r   r   r<   )%r   r   r   r   r   ContractAPIErrorr   rY   AttachInvalidTokenErrorr   r   r   nowr   utctotal_secondsr   E_ATTACH_FORBIDDEN_EXPIREDrS   strftimer   eventerrorrH   r(   infoSTATUS_TOKEN_NOT_VALIDE_ATTACH_FORBIDDEN_NOT_YETr   r   r   r   r   r   r+   r   r   )r[   r   r   r   r   contract_informationecontract_infoaccount_infor   expiration_datetimedeltarZ   effective_datetimer   r   rm   r   r   rI   entitlement_informationr   r   rJ   r   s   &&&                      rK   simulate_statusr    s    C}}^,H7C ),,^R@M'++M2>LOOm''b1))&"5m//R@M--j"=	 ((4l&&t,l..{B?&(8(8(")	 	
( ,,x||
$C''+//>&y1#) A%99@@$Z06(112IJ A G KK'++',,KGJJ//$6DtK C)) - 1 1/ B%k2( A%99@@$Z06'001HI A G KK'++',,KGJJ//$6DtK C',I y.ABBH$$ 	B   !$$%;R@L#<<3	%#4DEC #?*#
 	##]CHH=s3J? 7 G XX-CCE
	
 ( Z"=>*<CGz}-11.A9EHZ !56OO&s+, $<<
B7
7{{;.%7 G7 	 

  2=Q && 1f!&&C-4466v 22 		6
sA   S 6T%T%T* U>UT"#:TT"*UUc                0    V ^8  d   QhR\         R\         /# )rO   stringrP   )rR   )rS   s   "rK   rT   rT   %  s        rU   c                x    \         P                  P                  4       '       d   \        P	                  W 4      # T # )z=Return colorized string if using a tty, else original string.)sysstdoutisattySTATUS_HUMANIZE_COLORIZEr   )r  s   &rK   for_human_colorizedr  %  s6     :: 	!$$V4 rU   c                \    V ^8  d   QhR\         \         \        ,          ,          R\        /# )rO   commandsrP   )r	   rR   )rS   s   "rK   rT   rT   .  s"      T#Y C rU   c                 T   R pV  F,  pV'       d
   VR,          pVRP                  V4      ,          pK.  	  RP                  \        P                  ! V\        ^,
          RR7      4      pRV9   d   RpRpMR	pR
pRP	                  \
        P                  VVV\
        P                  R7      # )r9   z &&  z \
z  )widthsubsequent_indentr   z{
  z
}z{ z }z%{color}{prefix}{content}{suffix}{end})colorprefixcontentsuffixend)jointextwrapwrapr   rS   r$   DISABLEGREYENDC)r  r  cmdwrapped_contentr  r  s   &     rK   colorize_commandsr!  .  s    GvG388C=   ll,q0T	
O
 299""MM :  rU   c                    V ^8  d   QhR\         \        \        \        3,          ,          R\        \        ,          R\         \        ,          /# )rO   column_dataheaderrP   )r	   r   rR   r
   )rS   s   "rK   rT   rT   J  s9      eCHo&08	#YrU   c           	        . pV'       d   VP                  V4       \        V  Uu. uF  p\        V^ ,          4      NK  	  up4      pV^ 8  dB   RP                  V4      pTP	                  V  Uu. uF  q5P                  ! V!  NK  	  up4       V# TP	                  V  Uu. uF  q3^,          NK  	  up4       V# u upi u upi u upi )zReturn a list of content lines to print to console for a section

Content lines will be center-aligned based on max value length of first
column.
z{{:>{}}}: {{}})r   maxlenrS   extend)r#  r$  r  pairtemplate_lengthtemplates   &&    rK   get_section_column_contentr,  J  s     GvK@KD3tAw<K@AO#**?;;G;4.;GH N 	K8KDQK89N A H 9s   B8.B=Cc                F    V ^8  d   QhR\         \        ,          R\        /# )rO   r1   rP   )r
   r   rR   )rS   s   "rK   rT   rT   _  s     % %HX. %3 %rU   c                     V f   \         P                  #  V P                  4       p V P	                  R4      #   \         d     Li ; i)Nz%c %Z)r   STATUS_CONTRACT_EXPIRES_UNKNOWN
astimezone	Exceptionr   )r1   s   &rK   format_expiresr2  _  sM    777$$& G$$  s   7 AAc                ^    V ^8  d   QhR\         \        \        3,          R\        R\        /# )rO   r*   r   rP   )r   rR   r   r   )rS   s   "rK   rT   rT   i  s.     y y4S> yT yc yrU   c                   V P                  R4      '       Eg   V P                  R4      '       d   V P                  RR4      '       g   \        P                  # \        P	                  \        P
                  \        P                  \        P                  \        P                  \        P                  R7      .pV P                  R. 4       F(  pVP                  \        P                  ! R&/ VB 4       K*  	  RP                  V4      # V P                  RR4      '       g   \        P                  .pM\        P	                  \        P
                  \        P                  \        P                  R7      .pV P                  R. 4       F  pVP                  R4      pV'       d   TMVP                  R	R
4      pVP                  R4      R8X  d   \        P                  M\        P                  pVP                  \        P	                  VP                  RR
4      VVR7      4       K  	  V P                  R4      pV'       d1   VP                  \        P                  4       VP!                  V4       V P                  R4      '       dy   VP                  R\        P"                  ,           4       \%        V P                  R/ 4      P'                  4       4       F%  w  rVP                  RP	                  W4      4       K'  	  V'       g"   VP!                  R
\        P(                  .4       VP!                  R
\        P*                  P,                  .4       \.        P0                  ! 4       \.        P2                  P4                  8X  d"   VP!                  R
\        P6                  .4       RP                  V4      # . p
RpV P                  RR4      '       g   \        P                  .pEM\8        .pV P                  R. 4       EF  pVP                  RR
4      pVP                  R4      pV'       d   TMVP                  R	R
4      pRVP                  RR
4      R\;        V4      R\;        VP                  RR
4      4      R	V/pVP                  RR4      pVe(   VP                  RR4      pVe   V
P                  V4       VP                  R4      pV'       d&   V'       g   RpRP	                  VR,          4      VR&   VP                  \<        P                  ! R&/ VB 4       V'       g   EK*  V'       g   EK5  \?        VP'                  4       4       F  w  pw  ppV\A        V4      ^,
          8w  d   RMRpVP                  \B        P	                  VVP                  R4      \;        VP                  RR
4      4      \;        VP                  RR
4      4      VP                  R	R
4      R7      4       K  	  EK  	  V'       d1   VP                  R
4       VP                  \        PD                  4       V P                  R4      '       g   \A        V
4      ^ 8  d|   VP                  R
4       VP                  \        P                  4       V P                  R4      pV'       d   VP!                  V4       \A        V
4      ^ 8  d   VP!                  V
4       V P                  R4      '       dy   VP                  R\        P"                  ,           4       \%        V P                  R/ 4      P'                  4       4       F%  w  rVP                  RP	                  W4      4       K'  	  VP                  R
4       V'       gH   V'       d!   VP                  \        PF                  4       MVP                  \        P(                  4       VP                  \        PH                  P	                  RR7      4       . pV P                  R/ 4      P                  RR4      pV'       d"   VP                  \        PJ                  V34       V P                  R / 4      P                  RR4      pV'       d"   VP                  \        PL                  V34       V P                  R!R4      R"8w  d   VP                  \        PN                  \Q        V P                  R#4      4      34       V P                  R / 4      P                  R$R4      pVP                  \        PR                  \;        V4      34       V'       d-   VP                  R
4       VP!                  \U        VR%7      4       RP                  V4      # )'z&Format status dict for tabular output.r/   r?   r3   N)r(   r^   r)   r   r+   r   )r(   r^   r+   r]   r+   r9   r^   rX   r(   r    r6   z{}: {}Fr)   r*   r`   rZ   ra   Tz{}*u   ├u   └)markerr(   r)   r*   r+   zpro enable <service>)commandr=   unknownr7   r2   freer1   r<   )r#  r   )+r   r   STATUS_NO_SERVICES_AVAILABLESTATUS_SIMULATED_TMPLrS   STATUS_SERVICESTATUS_AVAILABLESTATUS_ENTITLEDSTATUS_AUTO_ENABLEDSTATUS_DESCRIPTIONr   r  STATUS_UNATTACHED_TMPLSTANDALONE_YESSTANDALONE_NOSTATUS_NOTICESr(  STATUS_FEATURESr   ri   STATUS_ALL_HINTE_UNATTACHEDrH   r   r   r   r   )LIVEPATCH_KERNEL_NOT_SUPPORTED_UNATTACHEDSTATUS_HEADERr  STATUS_TMPL	enumerater'  VARIANT_STATUS_TMPLSTATUS_SERVICE_HAS_VARIANTSSTATUS_ALL_HINT_WITH_VARIANTS"STATUS_FOOTER_ENABLE_SERVICES_WITHSTATUS_FOOTER_ACCOUNTSTATUS_FOOTER_SUBSCRIPTIONSTATUS_FOOTER_VALID_UNTILr2  STATUS_FOOTER_SUPPORT_LEVELr,  )r*   r   r  rJ   r   r+   r^   r    r   rl   service_warningshas_variantsrq   r)   fmt_argsr`   warning_messagera   idx_variantr5  pairsaccount_namecontract_namer<   s   &&                        rK   format_tabularr]  i  sc   ::j!!::k""::j$//<<< &,,!00&77%55!)!=!= ( ; ; - G "::j"54;;FgFG 6 99W%%zz*d++<<=G '--!00&77 ( ; ; . G "::j"5!(-C!D & # ]B7  {{;/58 ++!// 
 *11$[[4"+$/ 2  6( **Y'NN8223NN7#::j!!NN4(":"::;$VZZ
B%?%E%E%GH
xs:; I NNB 8 89:H115567))+))556 NNXGGH yy!!L::j$''889 /$jjR8N%))*b9H+//0FGN " #''r:  **626/9-"&&x4 {H %((D9G"")++i">".$++O<%))*5H##(<<0@#A NN;--99:xHH)28>>3C)D%C!W&)S]Q->&>UEFNN+22#)!(V!4%8 'J ;& $7 'Hb 9$ )0M2(F 3 
 *E9 9X rx;;<zz)$4 5 9rx../**Y'NN7# 1$NN+,zz*th6667 J!;!A!A!CDJCNN8??367 ENN2NN8AABNN8334NN33::* 	; 	

 E::i,00CLh44lCDJJz2.2269EMh99=IJzz(D!V+22vzz)45	
 $ZZ
B7;; )
 	44#$67	
 r1eDE99WrU   c                h   \        V 4      pRp\        4       pWR&   V F?  pVR,          V8X  g   VP                  R4      V8X  g   K)   \        WR,          R7      pTp M	  Vf   \        P                  ! VR7      h\        V 4      P                  '       d(   \        X/ V 4      pVR,          pVR,          VR&   WR&   MHVR,          '       d   \        P                  P                  p	M\        P                  P                  p	WR&   XP                  VR	&   V#   \        P
                   d     EK  i ; i)
zReturn help information from an uaclient service as a dict

:param name: Name of the service for which to return help data.

:raises: UbuntuProError when no help is available.
Nr(   r   r   r   r*   r)   r^   help)r   r   r   r   r   r   NoHelpContentr   r   rj   r   r   rl   re   	help_info)
r[   r(   r   help_resourceresponse_dictr   help_entrq   
status_msgr^   s
   &&        rK   r_  r_  %  s)    (,IM
  MM &Ft#x||M'Bd'J.3f=MN %M  &&D11C$$$1(BD#H-
$2:$>j!",h %%.88>>I.::@@I%.k"$..M&1 66 s   DD10D1)F)N)or   loggingr
  r  collectionsr   r   r   enumr   typingr   r   r	   r
   r   uaclientr   r   r   r   r   r   r   (uaclient.api.u.pro.status.is_attached.v1r   uaclient.configr   r   uaclient.contractr   r   uaclient.defaultsr   r   uaclient.entitlementsr   (uaclient.entitlements.entitlement_statusr   r   r   r   uaclient.filesr   r    r!   r"   uaclient.files.noticesr#   uaclient.messagesr$   get_event_loggerr   	getLoggerreplace_top_level_logger_name__name__r   	ESSENTIALSTANDARDADVANCEDr   rl   OKGREENSTATUS_STATUS_ENABLEDr  r   FAILSTATUS_STATUS_DISABLEDrf   r  STATUS_STATUS_INAPPLICABLEre   STATUS_STATUS_UNAVAILABLErh   WARNINGYELLOWSTATUS_STATUS_WARNINGENTITLEDSTATUS_ENTITLED_ENTITLEDrd   STATUS_ENTITLED_UNENTITLEDSTATUS_SUPPORT_ESSENTIALSTATUS_SUPPORT_STANDARDSTATUS_SUPPORT_ADVANCEDr  r@  r:  rS   r;  r=  STATUS_STATUSr?  rH  rI  rK  get_versionr   r   rL   rj   r   r   r   r*   r   r  r  r!  r,  r2  r]  r_  r   rU   rK   <module>r     s4     
  # '  3 3   B : O G 5   * &%%'::8DE 	
 !!8999HMMI##777(--G!!''

-
-	.
--	   &&

,
,	-
--	 ""!?!??(--O!!8<<<x}}L##

-
-	.
--	 x''(mm h&&'mm h&&'mmE% P D N  GMM		 	 %%!!++	 N  EC 
 # u w""$	
 $   t d  .77== 66  r bbB.;;AA, bb	-8 9@8vDN+\,^<G(up8*%yx,rU   