ó
    €Ï'  ã                   óÊ   • S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r	  SSK
Jr  SS	K
Jr  SS
Kr " S S\R                  5      rS r " S S\R"                  5      rg
)z=A module for diagnosing common problems caused by properties.é    )Úabsolute_import)Údivision)Úunicode_literals)Úconfig)Ú
properties)Únamed_configs)Ú
check_base)Údiagnostic_baseNc                   ó,   ^ • \ rS rSrSrU 4S jrSrU =r$ )ÚPropertyDiagnosticé   z2Diagnoses issues that may be caused by properties.c                 óD   >• Sn[         [        U ]  US[        U5      /S9  g )NzDProperty diagnostic detects issues that may be caused by properties.zProperty diagnostic)ÚintroÚtitleÚ	checklist)Úsuperr   Ú__init__ÚHiddenPropertiesChecker)ÚselfÚ ignore_hidden_property_allowlistr   Ú	__class__s      €Ú;lib/googlecloudsdk/core/diagnostics/property_diagnostics.pyr   ÚPropertyDiagnostic.__init__!   s2   ø€ ð€Eä	Ô
˜dÑ,ØÐ0Ü*Ð+KÓLÐMð -ò Oó    © )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú__static_attributes__Ú__classcell__)r   s   @r   r   r      s   ø† Ù:÷Oó Or   r   c               #   óT   #   • [         R                   H  n U  H  nUv •  M	     M     g 7f)N)r   ÚVALUES)ÚsectionÚprops     r   Ú_AllPropertiesr'   )   s$   é € Ü×"Ô"€gÛˆØ„jó ò #ùs   ‚&(c                   óH   • \ rS rSrSrSrS r\S 5       rSS jr	S r
S rS	rg
)r   é/   z3Checks whether any hidden properties have been set.)zmetrics/environmentzcore/universe_domainc                 ó  • Xl         [        [        R                  R                  R
                  R                  5       =(       d    SR                  S5      5      U l        [        R                  R                  5       U l        g )NÚ Ú,)r   Úsetr   r$   ÚdiagnosticsÚhidden_property_allowlistÚGetÚsplitÚ	allowlistr   ÚActivePropertiesFileÚLoadÚ_properties_file)r   r   s     r   r   Ú HiddenPropertiesChecker.__init__7   sY   € Ø,LÔ)ÜÜ	×	Ñ	×	&Ñ	&×	@Ñ	@×	DÑ	DÓ	F×	LÈ"ß	‰ˆs‹ó€D„Nô *×>Ñ>×CÑCÓE€DÕr   c                 ó   • g)Nzhidden propertiesr   )r   s    r   ÚissueÚHiddenPropertiesChecker.issue?   s   € àr   c                 ó”  • / n[        5        HT  nUR                  (       a  M  UR                  (       d  M)  U R                  U5      nU(       d  MC  UR	                  U5        MV     U(       a+  U R                  X!5      n[        R                  " SUUS9nUS4$ SR                  U(       a  SOS5      n[        R                  " SUS9nUS4$ )	a%  Run hidden property check.

Args:
  first_run: bool, True if first time this has been run this invocation.

Returns:
  A tuple of (check_base.Result, fixer) where fixer is a function that can
    be used to fix a failed check, or None if the check passed or failed
    with no applicable fix.
F)ÚpassedÚmessageÚfailuresNzHidden Property Check {0}.r;   z
now passesT)r;   r<   )	r'   Úis_internalÚ	is_hiddenÚ_CheckHiddenPropertyÚappendÚ_ConstructMessageFromFailuresr	   ÚResultÚformat)r   Ú	first_runr=   r&   ÚfailÚfail_messageÚresultÚpass_messages           r   ÚCheckÚHiddenPropertiesChecker.CheckC   sµ   € ð €HÜÖ ˆØ	×	×	ÙØ	‰Ø×(Ñ(¨Ó.ˆßˆ4Ø
/‰/˜$Ö
ñ !ö Ø×7Ñ7¸ÓL€lÜ× Ò ¨°|Ø*2ñ4€fàTˆ\Ðà/×6Ñ6Þ‰ <ó1€Lä×Ò d°LÑA€FØ4ˆ<Ðr   c                 óJ  • [         R                  " U5      U R                  ;   a  g U R                  (       d%  [         R                  " U5      U R                  ;   a  g [
        R                  " XR                  5      nUb%  SR                  U5      n[        R                  " US9$ g )Nz[{0}])r<   )ÚsixÚ	text_typeÚ
_ALLOWLISTr   r2   r   Ú_GetPropertyWithoutCallbackr5   rD   r	   ÚFailure)r   r&   ÚvalueÚmsgs       r   r@   Ú,HiddenPropertiesChecker._CheckHiddenPropertya   s}   € Ü
‡}‚}TÓ˜dŸo™oÓ-ØØ×1×1ÜŠdÓ˜tŸ~™~Ó-Øô ×2Ò2°4×9NÑ9NÓO€EØÑØN‰N˜4Ó €cÜ×Ò¨Ñ,Ð,ð r   c                 ó^  • SR                  U(       a  SOS5      nU(       a  US-  nU H!  nUSR                  UR                  5      -  nM#     U(       aX  USR                  [        R                  R	                  5       R
                  [        R                  " 5       R                  5      -  nU$ )NzHidden Property Check {0}.
Úfailedzstill does not passz/The following hidden properties have been set:
z    {0}
z5Properties files
    User: {0}
    Installation: {1}
)	rD   r<   r   ÚConfigurationStoreÚActiveConfigÚ	file_pathr   ÚPathsÚinstallation_properties_path)r   r=   rE   r<   Úfailures        r   rB   Ú5HiddenPropertiesChecker._ConstructMessageFromFailuresn   s–   € Ø,×3Ñ3Æ	±HØ4IóK€GæØÐCÑC€gÛˆØ×#Ñ# G§O¡OÓ4Ñ4‚gñ æØð ,ç,2©FÜ#×6Ñ6×CÑCÓE×OÑOÜ—l’l“n×AÑAó-Cñ€gð €Nr   )r5   r2   r   N)T)r   r   r   r   r    rO   r   Úpropertyr8   rJ   r@   rB   r!   r   r   r   r   r   /   s5   † Ù;ð€*ò
Fð ñó ðôò<-õr   r   )r    Ú
__future__r   r   r   Úgooglecloudsdk.corer   r   Ú"googlecloudsdk.core.configurationsr   Úgooglecloudsdk.core.diagnosticsr	   r
   rM   Ú
Diagnosticr   r'   ÚCheckerr   r   r   r   Ú<module>re      sS   ðñ  Då &Ý Ý 'å &Ý *Ý <Ý 6Ý ;Û 
ôO˜×3Ñ3ô OòôM˜j×0Ñ0õ Mr   