+
    mi                        ^ RI t ^ RIt^ RIt^ RIt^ RIHt ^ RIHtHtHt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HtHtHtHt ^ RIHt ^ RIHtHtHtH t H!t!H"t"H#t#H$t$ ^ RI%H&t& ^ RI'H(t( ^ R	I)H*t*H+t+ ]PX                  ! 4       t-]P\                  ! ]P^                  ! ]04      4      t1 ! R
 R4      t2 ! R R] Pf                  R7      t4R# )    N)datetime)AnyDictListOptionalSetTupleTypeUnion)apiaptconfigcontractevent_logger
exceptionshttpmessagessnapsystemutil)_is_attached)ApplicabilityStatusApplicationStatusCanDisableFailureCanDisableFailureReasonCanEnableFailureCanEnableFailureReasonContractStatusUserFacingStatus)machine_token)status_cache_file)MessagingOperationsDictStaticAffordancec                   2   a  ] tR t^(t o V 3R lR ltRtV tR# )EntitlementWithMessagec                H   < V ^8  d   QhRS[ R,          RS[P                  /# )   entitlementUAEntitlement	named_msg)r
   r   NamedMessage)format__classdict__s   "</usr/lib/python3/dist-packages/uaclient/entitlements/base.py__annotate__#EntitlementWithMessage.__annotate__)   s*     # #/*# ((#    c                    Wn         W n        R # Nr(   r*   )selfr(   r*   s   &&&r.   __init__EntitlementWithMessage.__init__)   s    
 '"r1   r4   N)__name__
__module____qualname____firstlineno__r6   __static_attributes____classdictcell__r-   s   @r.   r%   r%   (   s     # #r1   r%   c                     a  ] tR t^2t o RtRtRtRtRtRwt	Rwt
RwtRtRtRtRtRt]V 3R lR l4       t]V 3R lR l4       t]]P*                  V 3R	 lR
 l4       4       t]]P*                  V 3R lR l4       4       t]V 3R lR l4       tV 3R lR lt]V 3R lR l4       t]V 3R lR l4       t]V 3R lR l4       t]V 3R lR l4       t]V 3R lR l4       tV 3R lR ltV 3R lR lt V 3R lR  lt!]V 3R! lR" l4       t"]V 3R# lR$ l4       t#]V 3R% lR& l4       t$V 3R' lR( lt%]R) 4       t&]V 3R* lR+ l4       t'RxV 3R, lR- llt(R. t)]R/ 4       t*]P*                  V 3R0 lR1 l4       t+]P*                  V 3R2 lR3 l4       t,V 3R4 lR5 lt-V 3R6 lR7 lt.V 3R8 lR9 lt/V 3R: lR; lt0V 3R< lR= lt1V 3R> lR? lt2V 3R@ lRA lt3V 3RB lRC lt4]P*                  V 3RD lRE l4       t5V 3RF lRG lt6V 3RH lRI lt7V 3RJ lRK lt8RL t9RM t:V 3RN lRO lt;RyV 3RP lRQ llt<V 3RR lRS lt=]P*                  V 3RT lRU l4       t>V 3RV lRW lt?V 3RX lRY lt@V 3RZ lR[ ltAV 3R\ lR] ltBRyV 3R^ lR_ lltCV 3R` lRa ltDV 3Rb lRc ltEV 3Rd lRe ltF]P*                  V 3Rf lRg l4       tGV 3Rh lRi ltHV 3Rj lRk ltIV 3Rl lRm ltJV 3Rn lRo ltKV 3Rp lRq ltLRzV 3Rr lRs lltMV 3Rt lRu ltNRvtOV tPR# ){r)   NF Tc                    < V ^8  d   QhRS[ /# r'   returnstr)r,   r-   s   "r.   r/   UAEntitlement.__annotate__T   s      c r1   c                    R# )z?The lowercase name of this entitlement, in case it is a variantr@    r5   s   &r.   variant_nameUAEntitlement.variant_nameS   s     r1   c                0   < V ^8  d   QhRS[ S[,          /# rB   )r   rE   )r,   r-   s   "r.   r/   rF   Y   s      T#Y r1   c                    V P                   .pV P                  V P                   8w  d   VP                  V P                  4       V# )z1The list of names this entitlement may be called.)namepresentation_nameappend)r5   valid_namess   & r.   rQ   UAEntitlement.valid_namesX   s;     yyk!!TYY.t556r1   c                    < V ^8  d   QhRS[ /# rB   rD   )r,   r-   s   "r.   r/   rF   b   s      s r1   c                    R# )z,The human readable title of this entitlementNrH   rI   s   &r.   titleUAEntitlement.title`        	r1   c                    < V ^8  d   QhRS[ /# rB   rD   )r,   r-   s   "r.   r/   rF   h   s      S r1   c                    R# )z&A sentence describing this entitlementNrH   rI   s   &r.   descriptionUAEntitlement.descriptionf   rW   r1   c                    < V ^8  d   QhRS[ /# rB   rD   )r,   r-   s   "r.   r/   rF   m   s      3 r1   c                   V P                   '       d   V P                  # V P                  P                  '       dG   V P                  P                  R/ 4      P                  R/ 4      P                  RV P                  4      # V P                  # )z/The user-facing name shown for this entitlementr(   affordancespresentedAs)
is_variantrJ   machine_token_file
is_presententitlement_cfggetrN   rI   s   &r.   rO   UAEntitlement.presentation_namel   sn     ???$$$$$///$$((;]B']DII. 99r1   c                v   < V ^8  d   QhRS[ S[S[3,          RS[S[S[S[P                  ,          3,          /# )r'   platform_checkrC   )r   rE   r   r	   boolr   r   r+   )r,   r-   s   "r.   r/   rF   z   s:      "38n	tXh3344	5r1   c                    R# )zVerify specific platform checks for a service.

This should only be used if the service requires custom platform checks
to check if it is available or not in the machine.
TNrH   )r5   rg   s   &&r.   verify_platform_checks$UAEntitlement.verify_platform_checksz   s
     r1   c                    < V ^8  d   QhRS[ /# rB   rD   )r,   r-   s   "r.   r/   rF      s      3 r1   c                T   V P                   pV P                  '       d   V P                  P                  4        UUu. uF   w  r#RP                  W#P                  4      NK"  	  pppRP                  R\        P                  ,           R,           .V,           4      pW,          pV# u uppi )z$Help information for the entitlementz
  * {}: {}
z

)	help_textvariantsitemsr,   rZ   joinr   CLI_HELP_VARIANTS_HEADER)r5   rp   rJ   variant_clsvariant_itemsvariant_texts   &     r.   	help_infoUAEntitlement.help_info   s     NN	=== 261D1D1F1F-L ##L2I2IJ1F  
  99(;;;dBC L %Is   &B$c                4   < V ^8  d   QhRS[ S[R3,          /# r'   rC   .)r	   r#   )r,   r-   s   "r.   r/   rF      s      E*:C*?$@ r1   c                    R# )NrH   rH   rI   s   &r.   static_affordances UAEntitlement.static_affordances       	r1   c                4   < V ^8  d   QhRS[ S[R3,          /# r{   r	   r%   )r,   r-   s   "r.   r/   rF      s     + +u-CS-H'I +r1   c                    V P                   # )z
Return a list of packages that aren't compatible with the entitlement.
When we are enabling the entitlement we can directly ask the user
if those entitlements can be disabled before proceding.
Overridden in livepatch and fips
)_incompatible_servicesrI   s   &r.   incompatible_services#UAEntitlement.incompatible_services   s     ***r1   c                4   < V ^8  d   QhRS[ S[R3,          /# r{   r   )r,   r-   s   "r.   r/   rF      s     ' '5)?)D#E 'r1   c                    V P                   # )z
Return a list of packages that must be active before enabling this
service. When we are enabling the entitlement we can directly ask
the user if those entitlements can be enabled before proceding.
Overridden in ros and ros-updates.
)_required_servicesrI   s   &r.   required_servicesUAEntitlement.required_services   s     &&&r1   c                B   < V ^8  d   QhRS[ S[R,          R3,          /# )r'   rC   r)   .)r	   r
   )r,   r-   s   "r.   r/   rF      s#     ( (E$*?*D$E (r1   c                    V P                   # )z
Return a list of packages that depend on this service.
We will use that list during disable operations, where
a disable operation will also disable all of the services
required by the original service
Overriden in esm-apps and esm-infra
)_dependent_servicesrI   s   &r.   dependent_services UAEntitlement.dependent_services   s     '''r1   c                D   < V ^8  d   QhRS[ S[S[R,          3,          /# r'   rC   r)   r   rE   r
   )r,   r-   s   "r.   r/   rF      s#      tCo)>$>? r1   c                    / # r3   rH   rI   s   &r.   _get_variantsUAEntitlement._get_variants   s    	r1   c                0   < V ^8  d   QhRS[ S[,          /# rB   )r   rE   )r,   r-   s   "r.   r/   rF      s      C r1   c                   \        4       pV P                  4       pVP                  R/ 4      P                  R. 4      pV F?  pVP                  R/ 4      P                  R4      pV'       g   K.  VP                  V4       KA  	  V# )zF
Fetch all available variants defined in the Contract Server response
r(   	overridesselectorvariant)set_base_entitlement_cfgrd   add)r5   valid_variantsrc   r   overrider   s   &     r.   _get_contract_variants$UAEntitlement._get_contract_variants   sx     446#''r:>>{BO	!Hll:r266yAGw""7+ "
 r1   c                D   < V ^8  d   QhRS[ S[S[R,          3,          /# r   r   )r,   r-   s   "r.   r/   rF      s&     A AT#tO/D*D%E Ar1   c                    V P                  4       pV P                  4       pR V9   d   R VR ,          /pM/ p\        V4       F  pWA9   g   K  W,          W4&   K  	  \        V4      ^8  d   V# / # )generic)r   r   sortedlen)r5   service_variantscontract_variantsr   r   s   &    r.   _get_valid_variants!UAEntitlement._get_valid_variants   sx    --/ 779((')9))DENN/0G**:*C' 1 "%^!4q!8~@b@r1   c                D   < V ^8  d   QhRS[ S[S[R,          3,          /# r   r   )r,   r-   s   "r.   r/   rF      s#     * *$sD$99: *r1   c                J    V P                   '       d   / # V P                  4       # )zN
Return a list of services that are considered a variant
of the main service.
)r`   r   rI   s   &r.   rq   UAEntitlement.variants   s!     ???I''))r1   c                D   < V ^8  d   QhRS[ S[S[R,          3,          /# r   r   )r,   r-   s   "r.   r/   rF      s#     
 
S$*?%? @ 
r1   c                    V P                   '       g   / # V P                  4       P                  4        UUu/ uF  w  rWP                  8w  g   K  WbK  	  upp# u uppi )z_
On a variant, return the other variants of the main service.
On a non-variant, returns empty.
)r`   r   rr   rJ   )r5   rN   clss   &  r.   other_variantsUAEntitlement.other_variants   s]     I "557==?
?	((( DI?
 	
 
s   AAc                .   < V ^8  d   QhRS[ R,          /# r   )r   )r,   r-   s   "r.   r/   rF      s      /!: r1   c                   V P                   P                  4        Fj  pVP                  R8X  d   K  V! V P                  V P                  V P
                  R7      pVP                  4       w  r4V\        P                  8X  g   Kh  Vu # 	  R# )z
On an enabled service class, return the variant that is enabled.
Return None if no variants exist or none are enabled (e.g. access-only)
r   )cfgcalled_nameaccess_onlyN)	rq   valuesrJ   r   _called_namer   application_statusr   ENABLED)r5   ru   r   status_s   &    r.   enabled_variantUAEntitlement.enabled_variant   sz      ==//1K''94!HH -- ,,G
  224IF*222 2 r1   c                    < V ^8  d   QhRS[ /# rB   rh   )r,   r-   s   "r.   r/   rF   	  s      T r1   c                    R# )z\
Only implemented on variant classes.
Returns True if this variant should be auto-selected.
FrH   rI   s   &r.   variant_auto_select!UAEntitlement.variant_auto_select	  s    
 r1   c                n    \        V P                  P                  4       4      pV'       d
   V^ ,          # R# )z
Cannot actually set the return type because
https://github.com/python/typing/issues/266
affects xenial.

:rtype: Optional[Type["UAEntitlement"]]
N)listrq   r   )r5   rq   s   & r.   default_variantUAEntitlement.default_variant  s+     ,,./A;r1   c                    < V ^8  d   QhRS[ /# rB   )r"   )r,   r-   s   "r.   r/   rF   !  s      2 r1   c                    / # r3   rH   rI   s   &r.   	messagingUAEntitlement.messaging   r   r1   c                   < V ^8  d   QhRS[ S[P                  ,          RS[RS[RS[RS[ S[S[,          ,          RR/# )r'   r   r   r   purge
extra_argsrC   N)r   r   UAConfigrE   rh   r   )r,   r-   s   "r.   r/   rF   $  sY     . .foo&. . 	.
 . T#Y'. 
.r1   c                    V'       g   \         P                  ! 4       pWn        \        P                  ! 4       V n        W0n        W@n        Ve   WPn        M. V n        W n	        RV n
        RV n        R# )zMSetup UAEntitlement instance

@param config: Parsed configuration dictionary
NF)r   r   r   r    get_machine_token_filera   r   r   r   r   _valid_service_is_sources_list_updated)r5   r   r   r   r   r   s   &&&&&&r.   r6   UAEntitlement.__init__$  s\     //#C"/"F"F"H&
!(O DO'"(-%r1   c                    \         P                  ! V P                  P                  4       P	                  V P
                  / 4      4      # r3   )copydeepcopyra   entitlementsrd   rN   rI   s   &r.   r   #UAEntitlement._base_entitlement_cfg>  s6    }}##00266tyy"E
 	
r1   c                    V P                  4       pV P                  '       d	   V'       g   V# \        P                  ! WP                  R 7       V# ))orig_accessr   )r   r`   r   apply_contract_overridesrJ   r5   rc   s   & r.   rc   UAEntitlement.entitlement_cfgC  s@    446o""))'1B1B	
 r1   c                    < V ^8  d   QhRS[ /# rB   int)r,   r-   s   "r.   r/   rF   Q  s      c r1   c                    R# )z
The number of steps that are reported as progress while enabling
this specific entitlement that are not shared with other entitlements.
NrH   rI   s   &r.   enable_stepsUAEntitlement.enable_stepsP       	r1   c                    < V ^8  d   QhRS[ /# rB   r   )r,   r-   s   "r.   r/   rF   Y  s      s r1   c                    R# )z
The number of steps that are reported as progress while disabling
this specific entitlement that are not shared with other entitlements.
NrH   rI   s   &r.   disable_stepsUAEntitlement.disable_stepsX  r   r1   c                    < V ^8  d   QhRS[ /# rB   r   )r,   r-   s   "r.   r/   rF   `  s      c r1   c                   V P                  4       pV P                  P                  R / 4      P                  R/ 4      P                  R4      pVe   \        V4      ^ 8  d
   V^,          pV P                  P                  R / 4      P                  R/ 4      P                  R4      pVe   \        V4      ^ 8  d
   V^,          pV P	                  4        F2  pWP                  V P                  4      P                  4       ,          pK4  	  V P                  4        F2  pWP                  V P                  4      P                  4       ,          pK4  	  V# )r(   
directivesrequiredSnapsrequiredPackages)	r   rc   rd   r   blocking_incompatible_servicesr(   r   r   blocking_required_services)r5   total_stepsrequired_snapsrequired_packagesincompatible_servicerequired_services   &     r.   calculate_total_enable_steps*UAEntitlement.calculate_total_enable_steps`  s*   '')  $$]B7Sr"S! 	
 %#n*=*A1K  $$]B7Sr"S#$ 	
 (S1B-Ca-G1K$($G$G$I ;;moK %J !% ? ? A77lnK !B r1   c                    < V ^8  d   QhRS[ /# rB   r   )r,   r-   s   "r.   r/   rF   z  s      s r1   c                    V P                  4       pV P                  4        F)  pW! V P                  4      P                  4       ,          pK+  	  V# r3   )r   blocking_dependent_servicesr   )r5   r   dependent_services   &  r.   calculate_total_disable_steps+UAEntitlement.calculate_total_disable_stepsz  sH    ((*!%!A!A!C,TXX6DDFFK "Dr1   c                F   < V ^8  d   QhRS[ S[S[S[,          3,          /# rB   )r	   rh   r   r   )r,   r-   s   "r.   r/   rF     s'     F FE$1A(B"BC Fr1   c                   V P                  4       '       dA   \        P                  RV P                  4       \        P
                  ! V P                  4       V P                  4       \        P                  8X  gF   R\        \        P                  \        P                  P                  V P                   R7      R7      3# V P#                  4       w  rV\$        P&                  8w  dF   R\        \        P(                  \        P(                  P                  V P                   R7      R7      3# V P+                  4       w  r4V\,        P.                  8X  d   R\        \        P.                  VR7      3# V P0                  '       d2   V P3                  4       '       d   R\        \        P4                  4      3# V P6                  '       d2   V P9                  4       '       g   R\        \        P:                  4      3# V P<                  '       gW   V P>                  '       dE   R\        \        P@                  \        PB                  P                  V P                   R7      4      3# R# )z
Report whether or not enabling is possible for the entitlement.

:return:
    (True, None) if can enable
    (False, CanEnableFailure) if can't enable
z(Updating contract on service '%s' expiryFrU   messagerj   )"is_access_expiredLOGdebugrN   r   refreshr   contract_statusr   ENTITLEDr   r   NOT_ENTITLEDr   
UNENTITLEDr,   rU   r   r   DISABLEDALREADY_ENABLEDapplicability_statusr   INAPPLICABLEr   detect_incompatible_servicesINCOMPATIBLE_SERVICEr   check_required_services_activeINACTIVE_REQUIRED_SERVICESsupports_access_onlyr   ACCESS_ONLY_NOT_SUPPORTED ENABLE_ACCESS_ONLY_NOT_SUPPORTED)r5   r   r   r  detailss   &    r.   
can_enableUAEntitlement.can_enable  s    !!##II@$))LTXX&##%)@)@@ *77$//66TZZ6H  !% 7 7 9!2!;!;; *::$44;;$**;M  )-(A(A(C%#6#C#CC *77  %%%0022$.CC  !!!6688$.II  (((T-=-=-= *DD==DD"jj E   r1   c                d   < V ^8  d   QhRS[ P                  RS[S[S[RS[3,          3,          /# )r'   progressrC   N)r   ProgressWrapperr	   rh   r   r   )r,   r-   s   "r.   r/   rF     s:     ; ;%%; 
tU4!1122	3;r1   c                   VP                  RV P                  P                  R4      4       V P                  4       w  r#V'       g   Vf   R# VP                  \
        P                  8X  d'   V P                  V4      w  rEV'       g   WSn        RV3# MIVP                  \
        P                  8X  d'   V P                  V4      w  reV'       g   WSn        RV3# MRV3# VP                  RV P                  P                  R4      4       V P                  '       g3   V P                  V4      '       g   R# V P                  V4      '       g   R# V P                  V4      pV'       g   R# R# )a  Enable specific entitlement.

@return: tuple of (success, optional reason)
    (True, None) on success.
    (False, reason) otherwise. reason is only non-None if it is a
        populated CanEnableFailure reason. This may expand to
        include other types of reasons in the future.
message_operationpre_can_enableF
pre_enableFNrj   )emitr   rd   r  reasonr   r  handle_incompatible_servicesr  r  _enable_required_servicesr   handle_required_snapshandle_required_packages_perform_enable)r5   r  r  failincompat_reterrorreq_retrets   &&      r.   enableUAEntitlement.enable  sN    	!3!34D!E	
  ??,
|"" 6 K KK&*&G&G'# $#(L $;& $ )DDE "&!?!?!I#(L $;& 
 d{")4>>+=+=l+KL --h77""00::""""8,r1   c                :   < V ^8  d   QhRS[ P                  RS[/# r'   r  rC   r   r  rh   )r,   r-   s   "r.   r/   rF     s%     U Uc.A.A Ud Ur1   c           	        V P                   P                  R/ 4      P                  R/ 4      P                  R4      pVf   R# \        P                  ! 4       '       gF   VP	                  R\
        P                  P                  RR7      4       \        P                  ! 4        \        P                  ! 4       '       gH   VP	                  R\
        P                  P                  R	R7      4        \        P                  ! R4       \        P                   ! V4        \        P"                  ! R4       \(        P*                  ! RV P,                  P.                  \(        P0                  4      p\(        P*                  ! RV P,                  P2                  \(        P4                  4      p\        P6                  ! VV\        P8                  R7       V'       d    VP;                  \
        P<                  4       \?        VR R7       F#  pVR,          p \        P@                  ! V4       K%  	  R#   \        P                   dS   p\        P                  R
TR7       TP	                  R\
        P                  P                  RR7      4        Rp?ELRp?ii ; i  \        P                   dV   p\        P                  RTR7       \$        P'                  \
        P                  P                  RR7      4        Rp?ELRp?ii ; i  \        PB                   dr    TP                  RR4      pTP                  R4      p	TP	                  R\
        PD                  P                  TR7      4       \        P                  ! TT	TR7        EK  i ; i)z-"install snaps necessary to enable a service.r(   r   r   NTinfosnapdpackagesz
snapd snapz!Failed to install snapd as a snap)exc_infozsnap install snapd)commandzFailed to refresh snapd snapzsnap refresh snapdr   https)
http_proxyhttps_proxyretry_sleepsc                 $    V P                  R 4      # rN   )rd   )xs   &r.   <lambda>5UAEntitlement.handle_required_snaps.<locals>.<lambda>E  s    QUU6]r1   )keyrN   classicConfinementSupportFchannel)r   )rE  classic_confinement_support)#rc   rd   r   is_snapd_installedr"  r   INSTALLING_PACKAGESr,   install_snapdis_snapd_installed_as_a_snapinstall_snapr   ProcessExecutionErrorr  warningEXECUTING_COMMAND_FAILEDrun_snapd_wait_cmdrefresh_snapeventr4  r   validate_proxyr   r;  PROXY_VALIDATION_SNAP_HTTP_URLr<  PROXY_VALIDATION_SNAP_HTTPS_URLconfigure_snap_proxySNAP_INSTALL_RETRIESr  INSTALLING_REQUIRED_SNAPSr   get_snap_infoSnapNotInstalledError INSTALLING_REQUIRED_SNAP_PACKAGE)
r5   r  r   er;  r<  snap_pkg	snap_namerF  rE  s
   &&        r.   r&  #UAEntitlement.handle_required_snaps  s      $$]B7Sr"S! 	 !&&((MM44;;W;M  0022MM,,33\3J	!!'* 	)	g& ((DHH'')L)L

 ))TXX))4+O+O
 	!!!#22	
 h@@A~3JKH (I""9-	 L. w 33 ?!L55<< 4 =   // 	KK6KCJJ11880 9  	8 33 .6ll//+ #,,y1==DD& E  !!#0K sE   .H* J L*J?AJJK>)A
K99K>BNNc                    < V ^8  d   QhRS[ /# rB   r   )r,   r-   s   "r.   r/   rF   ^  s     
 
 
r1   c                2   V P                   P                  R/ 4      P                  R/ 4      P                  R4      pV'       g   R# V Uu. uF  q"R,          NK  	  pp\        P                  ! 4       p\	        V Uu. uF  qUV9   NK	  	  up4      # u upi u upi )/install packages necessary to enable a service.r(   r   r   TrN   )rc   rd   r   get_installed_packages_namesall)r5   r   packagepackage_namesinstalled_packagesrequireds   &     r.   are_required_packages_installed-UAEntitlement.are_required_packages_installed^  s       $$]B7Sr"S#$ 	 !8IJ8IW8IJ ==?<IJM++MJ
 	
 K Ks   
B;Bc                :   < V ^8  d   QhRS[ P                  RS[/# r1  r2  )r,   r-   s   "r.   r/   rF   r  s!      1D1D  r1   c                   V P                   P                  R/ 4      P                  R/ 4      P                  R4      pV'       g   R# V P                  V4       V Uu. uF  q3R,          NK  	  pp\        P	                  RV4       VP                  \        P                  P                  RP                  V4      R7      4       \        P                  ! V4       R# u upi )	ra  r(   r   r   TrN   zInstalling packages %r r6  )rc   rd   _update_sources_listr  r  r  r   rH  r,   rs   r   run_apt_install_command)r5   r  r   rd  re  s   &&   r.   r'  &UAEntitlement.handle_required_packagesr  s       $$]B7Sr"S#$ 	 !!!(+8IJ8IW8IJ		*M:((//-0 0 	

 	##M2 Ks   Cc                    < V ^8  d   QhRS[ /# rB   r   )r,   r-   s   "r.   r/   rF     s     # #4 #r1   c                @   V P                   P                  R/ 4      P                  R/ 4      P                  R4      pV'       g   R# V Uu. uF&  pVP                  RR4      '       g   K  VR,          NK(  	  pp\        V4      ^ 8X  d   R# \        P	                  RV4       R	P                  V4      p\        P                  \        P                  P                  VR
7      4       \        P                  ! V\        P                  P                  VR
7      4       R# u upi )ra  r(   r   r   TremoveOnDisableFrN   zUninstalling packages %rrl  r6  )rc   rd   r   r  r  rs   rQ  r4  r   UNINSTALLING_PACKAGESr,   r   remove_packagesUNINSTALLING_PACKAGES_FAILED)r5   r   rd  re  package_names_strs   &    r.   !handle_removing_required_packages/UAEntitlement.handle_removing_required_packages  s      $$]B7Sr"S#$ 	 ! -
,{{,e4 GFOO, 	 
 }"		,m<HH]3

**11;L1M	
 	1188* 9 	
 -
s   
D)Dc                :   < V ^8  d   QhRS[ P                  RS[/# r1  r2  )r,   r-   s   "r.   r/   rF     s!      (;(;  r1   c                    R# )z
Enable specific entitlement. This should be implemented by subclasses.
This method does the actual enablement, and does not check can_enable
or handle pre_enable or post_enable messaging.

@return: True on success, False otherwise.
NrH   r5   r  s   &&r.   r(  UAEntitlement._perform_enable  s     	r1   c                0   < V ^8  d   QhRS[ S[,          /# rB   )r   r%   )r,   r-   s   "r.   r/   rF     s      5K0L r1   c                    . pV P                    Fg  pVP                  V P                  R7      P                  4       w  r4V\        P
                  \        P                  39   g   KV  VP                  V4       Ki  	  V# )z9
:return: List of incompatible services that are enabled
r   )r   r(   r   r   r   r   WARNINGrP   r5   r-  service
ent_statusr   s   &    r.   r   ,UAEntitlement.blocking_incompatible_services  sy     11G#//HH 0   " J !))!))  

7# 2 
r1   c                    < V ^8  d   QhRS[ /# rB   r   )r,   r-   s   "r.   r/   rF     s     > >d >r1   c                :    \        V P                  4       4      ^ 8  # )z
Check for incompatible services.

:return:
    True if there are incompatible services enabled
    False if there are no incompatible services enabled
)r   r   rI   s   &r.   r  *UAEntitlement.detect_incompatible_services  s     46689A==r1   c                t   < V ^8  d   QhRS[ P                  RS[S[S[S[P                  ,          3,          /# r1  r   r  r	   rh   r   r   r+   )r,   r-   s   "r.   r/   rF     s:     , ,%%, 
tXh3344	5,r1   c                *   \         P                  ! V P                  P                  RR7      pV P                  4        F  pVP	                  V P                  4      p\
        P                  P                  V P                  VP                  R7      pV'       d   RV3u # VP                  R\
        P                  P                  VP                  R7      4       VP                  V4      w  rgV'       d   K  Yg'       d   VP                  3u # R3u # 	  R# )	a  
Prompt user when incompatible services are found during enable.

When enabling a service, we may find that there is an incompatible
service already enable. In that situation, we can ask the user
if the incompatible service should be disabled before proceeding.
There are also different ways to configure that behavior:

We can disable removing incompatible service during enable by
adding the following lines into uaclient.conf:

features:
  block_disable_on_enable: true
z features.block_disable_on_enable)r   path_to_value)service_being_enabledr   Fr4  r  Nrj   )r   is_config_value_truer   r   r(   r   #E_INCOMPATIBLE_SERVICE_STOPS_ENABLEr,   rU   r"  DISABLING_INCOMPATIBLE_SERVICEdisabler  )r5   r  cfg_block_disable_on_enabler  ente_msgr-  r)  s   &&      r.   r$  *UAEntitlement.handle_incompatible_services  s    $ '+&?&?88<<<'
# ::<G%%dhh/C@@GG&*jj%(YY H E
 +e|#MM77>>II ?  H-IC3TT\\<<t<<) =, r1   c                :    \        V P                  4       4      ^ 8H  # )z
Check if all required services are active

:return:
    True if all required services are active
    False is at least one of the required services is disabled
)r   r   rI   s   &r.   r  ,UAEntitlement.check_required_services_active  s     42245::r1   c                    . pV P                    Ff  pVP                  V P                  4      P                  4       w  r4V\        P
                  \        P                  39  g   KU  VP                  V4       Kh  	  V# )z6
:return: List of required services that are disabled
)r   r(   r   r   r   r   r  rP   r  s   &    r.   r   (UAEntitlement.blocking_required_services  sl     --G#//9LLNMJ!))!))"  

7# . 
r1   c                t   < V ^8  d   QhRS[ P                  RS[S[S[S[P                  ,          3,          /# r1  r  )r,   r-   s   "r.   r/   rF     s:      %% 
tXh3344	5r1   c                   V P                  4        F  pVP                  V P                  R7      pVP                  R\        P
                  P                  VP                  R7      4       VP                  V4      w  rEV'       d   Kv  RpV'       dL   VP                  '       d:   VP                  P                  '       d   RVP                  P                  ,           p\        P                  P                  WcP                  R7      pWG3u # 	  R# )a  
Prompt user when required services are found during enable.

When enabling a service, we may find that there are required services
that must be enabled first. In that situation, we can ask the user
if the required service should be enabled before proceeding.
r  r4  r  r@   ro   )r+  r  rj   )r   r(   r   r"  r   ENABLING_REQUIRED_SERVICEr,   rU   r.  r  msgERROR_ENABLING_REQUIRED_SERVICE)r5   r  r   r  r-  r)  	error_msgr  s   &&      r.   r%  'UAEntitlement._enable_required_services  s     !% ? ? A"..HH / C MM2299#))9L 

8,IC3	DLLLT\\-=-=-= $t||'7'7 7I>>EE#YY F  x# !B& r1   c                L   < V ^8  d   QhRS[ RS[S[ S[S[,          3,          /# )r'   ignore_dependent_servicesrC   )rh   r	   r   r   )r,   r-   s   "r.   r/   rF   =  s-     = =)-=	tX/00	1=r1   c                @   V P                  4       w  r#V\        P                  8X  dF   R\        \        P
                  \        P
                  P                  V P                  R7      R7      3# V P                  4       w  rCV P                  '       d   V\        P                  8X  dF   R\        \        P                  \        P                  P                  V P                  R7      R7      3# V P                  '       d:   V'       g2   V P!                  4       '       d   R\        \        P"                  4      3# V P$                  '       gW   V P&                  '       dE   R\        \        P(                  \        P*                  P                  V P                  R7      4      3# R# )zReport whether or not disabling is possible for the entitlement.

:return:
    (True, None) if can disable
    (False, CanDisableFailure) if can't disable
Fr  r  rj   )r   r   r  r   r   ALREADY_DISABLEDr   r,   rU   r  rc   r   r  NOT_APPLICABLECANNOT_DISABLE_NOT_APPLICABLEr   detect_dependent_servicesACTIVE_DEPENDENT_SERVICESsupports_purger   PURGE_NOT_SUPPORTEDDISABLE_PURGE_NOT_SUPPORTED)r5   r  r   r   r  s   &&   r.   can_disableUAEntitlement.can_disable=  sk    !% 7 7 9!2!;!;;!+<<$55<<4::<N  #'";";"= $$$#':'G'GG !+::$BBII"jj J   """+D--//%/II  """tzzz!+??88??"jj @   r1   c                `   < V ^8  d   QhRS[ P                  RS[S[S[S[,          3,          /# r1  )r   r  r	   rh   r   r   )r,   r-   s   "r.   r/   rF   |  s3     ( (++(	tX/00	1(r1   c                   VP                  RV P                  P                  R4      4       V P                  4       w  r#V'       gP   Vf   R# VP                  \
        P                  8X  d'   V P                  V4      w  rEV'       g   WSn        RV3# MRV3# V P                  V4      '       g   R# V P                  4       '       g   R# VP                  RV P                  P                  R4      4       R# )aa  Disable specific entitlement

@param silent: Boolean set True to silence print/log of messages

@return: tuple of (success, optional reason)
    (True, None) on success.
    (False, reason) otherwise. reason is only non-None if it is a
        populated CanDisableFailure reason. This may expand to
        include other types of reasons in the future.
r  pre_disableFpost_disabler!  rj   )r"  r   rd   r  r#  r   r  _disable_dependent_servicesr  _perform_disablerw  )r5   r  r  r)  r-  r  s   &&    r.   r  UAEntitlement.disable|  s     	)4>>+=+=m+LM ,,.|""*DDE  ;;HE#&L $;& 
 d{"$$X..5577)4>>+=+=n+MNr1   c                :   < V ^8  d   QhRS[ P                  RS[/# r1  r2  )r,   r-   s   "r.   r/   rF     s!     
 
)<)< 
 
r1   c                    R# )a,  
Disable specific entitlement. This should be implemented by subclasses.
This method does the actual disable, and does not check can_disable
or handle pre_disable or post_disable messaging.

@param silent: Boolean set True to silence print/log of messages

@return: True on success, False otherwise.
NrH   r{  s   &&r.   r  UAEntitlement._perform_disable  s     	r1   c                    < V ^8  d   QhRS[ /# rB   r   )r,   r-   s   "r.   r/   rF     s     ; ;4 ;r1   c                :    \        V P                  4       4      ^ 8  # )z
Check for depedent services.

:return:
    True if there are dependent services enabled
    False if there are no dependent services enabled
)r   r   rI   s   &r.   r  'UAEntitlement.detect_dependent_services  s     43356::r1   c                >   < V ^8  d   QhRS[ S[R,          ,          /# r   )r   r
   )r,   r-   s   "r.   r/   rF     s      T$2G-H r1   c                    . pV P                    FM  pV! V P                  4      P                  4       w  r4V\        P                  8X  g   K<  VP                  V4       KO  	  V# )zW
Return list of depedent services that must be disabled
before disabling this service.
)r   r   r   r   r   rP   )r5   blockingdependent_service_clsr  r   s   &    r.   r   )UAEntitlement.blocking_dependent_services  s^    
 %)%<%<!1  " J .666 56 &= r1   c                t   < V ^8  d   QhRS[ P                  RS[S[S[S[P                  ,          3,          /# r1  r  )r,   r-   s   "r.   r/   rF     s8     # #++#	tXh3344	5#r1   c                   V P                  4        F  pV! V P                  R7      pVP                  R\        P                  P                  VP                  R7      4       VP                  V4      w  rEV'       d   Km  RpV'       dL   VP                  '       d:   VP                  P                  '       d   RVP                  P                  ,           p\        P                  P                  WcP                  R7      pRV3u # 	  R# )	a9  
Disable dependent services

When performing a disable operation, we might have
other services that depend on the original services.
If that is true, we will alert the user about this
and prompt for confirmation to disable these services
as well.

@param silent: Boolean set True to silence print/log of messages
r  r4  )r   r@   ro   )r+  r   Frj   )r   r   r"  r   DISABLING_DEPENDENT_SERVICEr,   rU   r  r  r  "FAILED_DISABLING_DEPENDENT_SERVICE)r5   r  r  r  r-  r)  r  r  s   &&      r.   r  )UAEntitlement._disable_dependent_services  s     &*%E%E%G!'DHH5CMM44;;%(YY <  H-IC3	DLLLT\\-=-=-= $t||'7'7 7IAAHH#ii I  cz!' &H* r1   c                    < V ^8  d   QhRS[ /# rB   r   )r,   r-   s   "r.   r/   rF     s      4 r1   c                    R# )z=Check if system needs to be rebooted because of this service.FrH   rI   s   &r.   _check_for_rebootUAEntitlement._check_for_reboot  s    r1   c                *   < V ^8  d   QhRS[ RS[RR/# )r'   	operationsilentrC   N)rE   rh   )r,   r-   s   "r.   r/   rF     s%      &*	r1   c                    V P                  4       '       d@   V'       g6   \        P                  \        P                  P                  VR7      4       R# R# R# )zCheck if user should be alerted that a reboot must be performed.

@param operation: The operation being executed.
@param silent: Boolean set True to silence print/log of messages
)r  N)r  rQ  r4  r   ENABLE_REBOOT_REQUIRED_TMPLr,   )r5   r  r  s   &&&r.   _check_for_reboot_msg#UAEntitlement._check_for_reboot_msg  sE     !!##FJJ44;;' <  -3#r1   c                Z   < V ^8  d   QhRS[ S[S[S[P                  ,          3,          /# rB   )r	   r   r   r   r+   )r,   r-   s   "r.   r/   rF     s.     g4 g4	"HX-B-B$CC	Dg4r1   c                   V P                   pV'       g!   \        P                  \        P                  3# V P
                   F&  w  r#pV! 4       V8w  g   K  \        P                  V3u # 	  VR,          P                  R/ 4      pVP                  RR4      pV P                  '       d   Ve   \        P                  ! 4       V9  du   \        P                  ! V4      p\        P                  \        P                  P                  V P                  \        P                  ! 4       RP!                  V4      R7      3# VP                  RR4      pV P"                  '       d   Ve}   \        P$                  ! 4       P&                  V9  dY   \        P                  \        P(                  P                  V P                  \        P$                  ! 4       P*                  R7      3# \        P,                  ! 4       p	VP                  R	R4      p
VP                  R
R4      pV P.                  '       dk   V
eg   V	P0                  V
9  dV   \        P                  \        P2                  P                  V P                  V	P4                  RP!                  V
4      R7      3# V P6                  '       d   V'       d   V	P8                  e   V	P:                  e   \        P<                  P                  V P                  V	P4                  VR7      p VP?                  R4      w  r\A        V4      p\A        V4      pT	P8                  T8  d   \        P                  T3# T	P8                  T8X  d$   T	P:                  T8  d   \        P                  T3# VP                  R/ 4      pV PI                  V4      w  ppV'       g   \        P                  V3# \        P                  R3#   \B         d,    \D        PG                  RT4       \        P                  T3u # i ; i)a  Check all contract affordances to vet current platform

Affordances are a list of support constraints for the entitlement.
Examples include a list of supported series, architectures for kernel
revisions.

:return:
    tuple of (ApplicabilityStatus, NamedMessage). APPLICABLE if
    platform passes all defined affordances, INAPPLICABLE if it doesn't
    meet all of the provided constraints.
r(   r^   architecturesNz, )rU   archsupported_archesseries)rU   r  kernelFlavorsminKernelVersion)rU   kernelsupported_kernels)rU   r  
min_kernel.z$Could not parse minKernelVersion: %splatformChecks)%rc   r   
APPLICABLEr   "NO_ENTITLEMENT_AFFORDANCES_CHECKEDr}   r  rd   affordance_check_archr   get_dpkg_archr   deduplicate_archesINAPPLICABLE_ARCHr,   rU   rs   affordance_check_seriesget_release_infor  INAPPLICABLE_SERIESpretty_versionget_kernel_infoaffordance_check_kernel_flavorflavorINAPPLICABLE_KERNELuname_release#affordance_check_kernel_min_versionmajorminorINAPPLICABLE_KERNEL_VERsplitr   
ValueErrorr  rM  rk   )r5   rc   error_messagefunctorexpected_resultr^   affordance_archesdeduplicated_archesaffordance_serieskernel_infoaffordance_kernelsaffordance_min_kernelinvalid_msgkernel_majorkernel_minormin_kern_majormin_kern_minoraffordances_platform_checkr-  r#  s   &                   r.   r  "UAEntitlement.applicability_status  s    ..#..;;  8<7N7N3MOyO+*77FF 8O &m488K'OOOTB&&&!-$$&.??"&"9"9:K"L#00**11**--/%)YY/B%C 2   (OOHd;(((!-'')008II $00,,33**!224CC 4   ,,.(___dC +0BD I///".!!);;'440077"jj*88*.))4F*G 8   444%!!-!!-"::AAjj"000 B K
	G-B-H-H-M*!$\!2!$\!2   >1*77DD!!^3%%6*77DD%0__5Er%J"112LMV'44f=="--t33)  G:) ,88+FFGs    )O 3PPc                    < V ^8  d   QhRS[ /# rB   )r   )r,   r-   s   "r.   r/   rF   m  s     ) ) )r1   c                   \        V P                  4      P                  '       g   \        P                  # V P
                  pV'       d/   VR,          P                  R4      '       d   \        P                  # \        P                  # )z=Return whether the user is entitled to the entitlement or notr(   entitled)r   r   is_attachedr   r  rc   rd   r	  r   s   & r.   r  UAEntitlement.contract_statusm  s^    DHH%111!,,,..}=AA*MM!***(((r1   c                Z   < V ^8  d   QhRS[ S[S[S[P                  ,          3,          /# rB   )r	   r   r   r   r+   )r,   r-   s   "r.   r/   rF   v  s+     4 4	(*?*?!@@	A4r1   c                   V P                  4       w  rV\        P                  8w  d   \        P                  V3# V P
                  pV'       g;   \        P                  \        P                  P                  V P                  R7      3# VR,          P                  RR4      RJ d;   \        P                  \        P                  P                  V P                  R7      3# V P                  4       w  rEV\        P                  8X  d   \        P                  V3# V\        P                   8X  d   \        P                   V3# V P#                  4       w  rgV'       d   \        P                   V3# \        P$                  V3# )z4Return (user-facing status, details) for entitlementr  r(   r  F)r  r   r  r   r  rc   UNAVAILABLEr   SERVICE_NOT_ENTITLEDr,   rU   rd   r   r   r  INACTIVEr  enabled_warning_statusACTIVE)r5   applicabilityr  rc   r   explanationrM  warn_msgs   &       r.   user_facing_status UAEntitlement.user_facing_statusv  sE    "&!:!:!</:::#00'99.. ,,--444::4F  ]+//
EBeK ,,--444::4F 
 +/*A*A*C'!2!;!;;#,,k99#4#<#<<#++[88 779#++X55&&33r1   c                Z   < V ^8  d   QhRS[ S[S[S[P                  ,          3,          /# rB   )r	   r   r   r   r+   )r,   r-   s   "r.   r/   rF     s+     	 		 (8+@+@"AA	B	r1   c                    R# )z{
The current status of application of this entitlement

:return:
    A tuple of (ApplicationStatus, human-friendly reason)
NrH   rI   s   &r.   r    UAEntitlement.application_status  s     	r1   c                Z   < V ^8  d   QhRS[ S[S[S[P                  ,          3,          /# rB   )r	   rh   r   r   r+   )r,   r-   s   "r.   r/   rF     s*     
 
	tXh3344	5
r1   c                    R# )z
If the entitlment is enabled, are there any warnings?
The message is displayed as a Warning Notice in status output

:return:
    A tuple of (warning bool, human-friendly reason)
r!  rH   rI   s   &r.   r  $UAEntitlement.enabled_warning_status  s
     r1   c                0   < V ^8  d   QhRS[ S[,          /# rB   )r   rE   )r,   r-   s   "r.   r/   rF     s      	#r1   c                    R # r3   rH   rI   s   &r.   status_description_override)UAEntitlement.status_description_override  s     r1   c                    < V ^8  d   QhRS[ /# rB   r   )r,   r-   s   "r.   r/   rF     s     	 	4 	r1   c                    V P                   P                  R4      pV'       g   R# \        P                  ! VR4      pV\        P                  ! 4       8  d   R# R# )z<Return entitlement access info as stale and needing refresh.expiresFz%Y-%m-%dT%H:%M:%S.%fZT)rc   rd   r   strptimeutcnow)r5   
expire_strexpirys   &  r.   r  UAEntitlement.is_access_expired  sH     ))--i8
"":/FGX__&&r1   c                    < V ^8  d   QhRS[ /# rB   )r   )r,   r-   s   "r.   r/   rF     s     * *4E *r1   c                b   \         P                  ! 4       pVf   \        P                  # VP	                  R. 4      pV F_  pVP	                  R4      V P
                  8X  g   K%  VP	                  R4      pVR8X  d   \        P                  u # \        P                  u # 	  \        P                  # )z6Check on the state of application on the status cache.servicesrN   r   enabled)r!   readr   r  rd   rN   r   )r5   status_cacheservices_status_listr  service_statuss   &    r.   "_check_application_status_on_cache0UAEntitlement._check_application_status_on_cache  s    (--/$---+//
B?+G{{6"dii/!(X!6!Y.,444,555 , !)))r1   c                R   < V ^8  d   QhRS[ S[S[3,          RS[S[,          RS[/# )r'   obligationsresourceTokenrC   )r   rE   r   r   rh   )r,   r-   s   "r.   r/   rF     s6     J JS>J:B3-J	Jr1   c                J    \        VP                  R 4      ;'       d    T4      # )enableByDefault)rh   rd   )r5   r0  r1  s   &&&r.   _should_enable_by_default'UAEntitlement._should_enable_by_default  s!     KOO$56HH=IIr1   c          
      d   < V ^8  d   QhRS[ S[S[3,          RS[ S[S[3,          RS[RS[RS[/# )r'   r   deltasallow_enableverboserC   )r   rE   r   rh   )r,   r-   s   "r.   r/   rF     sT     f f#s(^f S#Xf 	f
 f 
fr1   c                   V'       g   R# VP                  R/ 4      pVP                  R/ 4      p\        P                  ! 4       p\        V\        P
                  8H  4      pV'       gS   V'       d    \        P                  ! V4       VR,          pV'       d$   RV9   d   VR,          R\        P
                  39   pV'       Edm   V'       d   V'       d   V P                  4       p	MV P                  4       w  rV	\        P                  8w  Ed"   V P                  4       w  rV'       d   \        P                  RV P                  4       V P!                  \"        P$                  ! 4       4       V'       d>   \&        P                  \(        P*                  P-                  V P                  R7      4       R# V'       d   VP.                  MRp\        P1                  R	V P                  V4       V'       d>   \&        P                  \(        P2                  P-                  V P                  R7      4       R# VP                  R
4      pV'       g   VP                  R
4      pVP                  R/ 4      pV P5                  W4      pV P7                  4       w  pp
V'       Ed-   V'       Ed$   V'       d   \(        P8                  P-                  V P                  R7      pV'       d&   \&        P                  V\:        P<                  R7       V P?                  \"        P$                  ! 4       4       V'       d>   \&        P                  \(        P@                  P-                  V PB                  R7      4       R# V'       dP   \(        PD                  P-                  V P                  R7      p\&        P                  V\:        P<                  R7       R# R# )aW  Process any contract access deltas for this entitlement.

:param orig_access: Dictionary containing the original
    resourceEntitlement access details.
:param deltas: Dictionary which contains only the changed access keys
and values.
:param allow_enable: Boolean set True if allowed to perform the enable
    operation. When False, a message will be logged to inform the user
    about the recommended enabled service.
:param verbose: If True, display output to stdout

:return: True when delta operations are processed; False when noop.
:raise: UbuntuProError when auto-enable fails unexpectedly.
Tr(   r   r  Fz3Disabling %s after refresh transition to unentitledr  r@   zDCannot disable %s after refresh transition to unentitled.
Reason: %sr1  r0  r?  )	file_typer  )#rd   r!   r)  rh   r   DROPPED_KEYr   r   r-  r   r   r  r  r  r4  rN   r  r   r  rQ  r   DISABLE_DURING_CONTRACT_REFRESHr,   message_valuerM  )UNABLE_TO_DISABLE_DURING_CONTRACT_REFRESHr4  r  ENABLE_BY_DEFAULT_TMPLsysstderrr.  ENABLED_TMPLrU   ENABLE_BY_DEFAULT_MANUAL_TMPL)r5   r   r7  r8  r9  delta_entitlementdelta_directivesr*  transition_to_unentitledr   r   r  r)  fail_msgr1  delta_obligationsenable_by_defaultr  r  s   &&&&&              r.   process_contract_deltas%UAEntitlement.process_contract_deltas  s   * "JJ}b9,00rB(--/#'(9T=M=M(M#N ' 11&9$*=$9!z->>+<Z+H$$M ,( $#L%)%L%L%N"(,(?(?(A%"!%6%?%??$($4$4$6!HHM		 LL!4!4!67

$DDKK(,		 L (  6:t11rHKK2		 	 

$NNUU(,		 V 
 #8"JJ7M-11-D ::
 )
A:++55<<$))<LJJscjjJ9C//12JJx44;;$**;MN  "@@GG!YY H C JJscjjJ9r1   c                4   < V ^8  d   QhRS[ P                  /# )r'   r  )r   r  )r,   r-   s   "r.   r/   rF   @  s     - -S-@-@ -r1   c                    V P                   '       d   R # VP                  R\        P                  P	                  RR7      4       \
        P                  ! \
        P                  ! 4       4       RV n         R # )Nr4  zstandard Ubuntur?  T)r   r"  r   APT_UPDATING_LISTr,   r   update_sources_listget_system_sources_filer{  s   &&r.   rm  "UAEntitlement._update_sources_list@  sX    (((H..55;L5M	
 	 ; ; =>(,%r1   )r   r   r   r   r   r   ra   r   rH   )Nr@   FFN)F)FT)Qr8   r9   r:   r;   rN   help_doc_urlr  r  rp   r   r   r   r  r  r  r  r`   propertyrJ   rQ   abcabstractmethodrU   rZ   rO   rk   rx   r}   r   r   r   r   r   r   rq   r   r   r   r   r   r6   r   rc   r   r   r   r   r  r.  r&  rh  r'  rw  r(  r   r  r$  r  r   r%  r  r  r  r  r   r  r  r  r  r  r  r   r  r  r  r-  r4  rK  rm  r<   r=   r>   s   @r.   r)   r)   2   s    D L ! N I     "*.'%)" J              *   + + ' ' ( (  A A * * 
 
  $     . .4

 
 
 	  	  4 F FT; ;zU Un
 
( 4# #J 	  "> >, ,\; @= =~( (T 	
 
; ; # #J  g4 g4R) )4 4B 		 	
 
 
	 	* *(J J
f fP- -r1   r)   )	metaclass)5rU  r   loggingrA  r   typingr   r   r   r   r   r	   r
   r   uaclientr   r   r   r   r   r   r   r   r   r   r   (uaclient.api.u.pro.status.is_attached.v1r   (uaclient.entitlements.entitlement_statusr   r   r   r   r   r   r   r   uaclient.filesr    uaclient.files.state_filesr!   uaclient.typesr"   r#   get_event_loggerrQ  	getLoggerreplace_top_level_logger_namer8   r  r%   ABCMetar)   rH   r1   r.   <module>rd     s    
   
  E E E    B	 	 	 ) 8 D%%'::8DE# #U-ckk U-r1   