
                         b    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 rg	)
zNUtility function for the OS Config Troubleshooter to check service enablement.    )absolute_import)division)unicode_literals)
exceptions)
enable_api)utilsc                    SnSn [         R                  " U R                  S5      nU(       a  US-  nSnO// SQn[        R                  " XQ5      nUSR                  U5      -  n [        R                  " X#5      $ ! [        R                  [        R                  4 a#  nU[        R                  " U5      -  n SnANXSnAff = f)	zBChecks if the OS Config API is enabled for the specified instance.Fz > Is the OS Config API enabled? osconfig.googleapis.comYesT)servicesenabler
   zANo
OS Config is not enabled for this instance. To enable, run

{}N)r   IsServiceEnabledprojectr   GetCommandStringformatr   #GetServicePermissionDeniedExceptionapitools_exceptions	HttpErrorUnknownMessageResponse)instance_refrelease_trackcontinue_flagresponse_messageservice_enabledcommand_argscommanderrs           Slib/googlecloudsdk/command_lib/compute/os_config/troubleshoot/service_enablement.pyCheckr       s    -72 11,2F2F2KMO%mFl&&|CgM6'? 
	88 
8
8

'
'
) 2,,S112s   /A; .A; ;$CB==CN)__doc__
__future__r   r   r   apitools.base.pyr   r   googlecloudsdk.api_lib.servicesr   9googlecloudsdk.command_lib.compute.os_config.troubleshootr   r         r   <module>r(      s%    U &  ' > 6 6 K9r'   