
    H                     Z    d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	Z	ddl
Z
d Zy)	zParser for tfvar files.    )absolute_import)division)unicode_literals)errors)filesNc                     	 t        j                  |       }t        j                  |      }|S # t        $ r6}t        j                  d| z   dz   t        j                  |      z         d}~ww xY w)zParses a `tfvar` file and returns a dictionary of configuration values.

  Args:
    filename: The path to the `tfvar` file.

  Returns:
    A dictionary of configuration values.
  z Error encountered while parsing z: N)	r   ReadFileContentshcl2loads	Exceptionr   InvalidDataErrorsix	text_type)filenamefconfiges       =lib/googlecloudsdk/command_lib/infra_manager/tfvars_parser.pyParseTFvarFiler      sg    x(AZZ]FM	 

!
!*X5<s}}Q?OO s   +. 	A-1A((A-)__doc__
__future__r   r   r   (googlecloudsdk.command_lib.infra_managerr   googlecloudsdk.core.utilr   r
   r   r        r   <module>r      s$     &  ' ; *  
r   