File: //usr/lib/python3/dist-packages/samba/provision/__pycache__/common.cpython-310.pyc
o
�/a � @ sl d Z dZddlZddlmZ ddlmZ dZdZdZ d Z
d
d� Zddgfd
d�Zddgfdd�Z
dd� ZdS )z/Functions for setting up a Samba configuration.�restructuredText� N)�read_and_sub_file)� setup_dir�FULL� SUBDOMAIN�NT4SYNC�DRSc C s t j�t� | �S )zGReturn an absolute path to the provision tempate file specified by file)�os�path�joinr )�file� r
�8/usr/lib/python3/dist-packages/samba/provision/common.py�
setup_path( s r zrelax:0c C s( t |t�sJ �t||�}| �||� dS )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�datar
r
r �setup_add_ldif- s
r c C s t ||�}| �||� dS )z�Modify 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 r
r
r �setup_modify_ldif: s
r c C sB | dusJ �| � � zt| ||� W n | �� � | �� dS )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_cancel�transaction_commit)r r r r
r
r � setup_ldbE s
r )�__doc__�
__docformat__r �sambar �samba.paramr � FILL_FULL�FILL_SUBDOMAIN�FILL_NT4SYNC�FILL_DRSr r r r r
r
r
r �<module> s