
    ph                     f    d Z dZddlZddlmZ ddlmZ dZdZdZ	d	Z
d
 ZddgfdZddgfdZd ZdS )z/Functions for setting up a Samba configuration.restructuredText    N)read_and_sub_file)	setup_dirFULL	SUBDOMAINNT4SYNCDRSc                     t           j                            t                      |           }t           j                            |          st          d|z            |S )zGReturn an absolute path to the provision tempate file specified by filez>File [%s] not found. Please install samba-ad-provision package)ospathjoinr   exists	Exception)filer   s     8/usr/lib/python3/dist-packages/samba/provision/common.py
setup_pathr   (   sL    7<<	T**D7>>$ aX[__```K    zrelax:0c                     t          |t                    sJ t          ||          }|                     ||           dS )a  Setup a ldb in the private dir.

    :param ldb: LDB file to import data into
    :param ldif_path: Path of the LDIF file to load
    :param subst_vars: Optional variables to subsitute in LDIF.
    :param nocontrols: Optional list of controls, can be None for no controls
    N)
isinstancestrr   add_ldifldb	ldif_path
subst_varscontrolsdatas        r   setup_add_ldifr   0   sC     i%%%%%Y
33DLLx     r   c                 R    t          ||          }|                     ||           dS )zModify a ldb in the private dir.

    :param ldb: LDB object.
    :param ldif_path: LDIF file path.
    :param subst_vars: Optional dictionary with substitution variables.
    N)r   modify_ldifr   s        r   setup_modify_ldifr!   =   s-     Y
33DOOD(#####r   c                     | J |                                   	 t          | ||           |                                  dS #  |                                   xY w)a6  Import a LDIF a file into a LDB handle, optionally substituting
    variables.

    :note: Either all LDIF data will be added or none (using transactions).

    :param ldb: LDB file to import into.
    :param ldif_path: Path to the LDIF file.
    :param subst_vars: Dictionary with substitution variables.
    N)transaction_startr   transaction_committransaction_cancel)r   r   r   s      r   	setup_ldbr&   H   sn     ???!sIz222
 	     	   s   A A)__doc____docformat__r   sambar   samba.paramr   	FILL_FULLFILL_SUBDOMAINFILL_NT4SYNCFILL_DRSr   r   r!   r&    r   r   <module>r0      s   4 6 5" 				 # # # # # # ! ! ! ! ! !	   /3i[ 
! 
! 
! 
! 26 $ $ $ $! ! ! ! !r   