a
    “I_ë  ã                   @   s0   d dl Z d dlZd dlZd dlmZ dd„ ZdS )é    N)ÚCommandErrorc                 C   s‚   t  d¡ t j¡}d}|D ]&}t j |d¡}t j |¡rd} qBq|sNtdƒ‚|d| d|  g}tj	|ddd}t  
d|  |¡ d	S )
z7Copy mdb file using mdb_copy utility and rename it
    ÚPATHFÚmdb_copyTzBmdb_copy not found. You may need to install the lmdb-utils packagez-nz%s.copy.mdb)Z	close_fdsÚshellN)ÚosÚgetenvÚsplitÚpathsepÚpathÚjoinÚexistsr   Ú
subprocessZ
check_callÚrename)Zfile1Zfile2ÚdirsÚfoundÚdZtoolpathZmdb_copy_cmdZstatus© r   ú0/usr/lib/python3/dist-packages/samba/mdb_util.pyr      s    r   )Zsambar   r   Zsamba.netcmdr   r   r   r   r   r   Ú<module>   s   