Файловый менеджер - Редактировать - /usr/lib64/python3.6/site-packages/samba/netcmd/domain/__pycache__/classicupgrade.cpython-36.pyc
Ðазад
3 �I�d� � @ s� d dl Z d dlZd dlZd dlZd dljZd dlmZ d dl m Z d dlmZ d dl mZmZmZ d dlmZ d dlmZ d dlmZ d d lmZ dd� ZG d d� de�ZdS )� N)�system_session)�system_session_unix)� get_string)�Command�CommandError�Option)�Samba3)�param)�upgrade_from_samba3� )�common_ntvfs_optionsc C sb t tjd�}tj| ddd| |gtj|d�}|j� \}}|j� |jd�}|r^t |d �j � S dS ) N�wz-sz-lz--parameter-name=%s)�stdout�stderr� r � )�open�os�devnull� subprocess�Popen�PIPEZcommunicate�close�splitr �strip)�testparm�smbconfZvarnameZerrfile�p�out�err�lines� r! �&/usr/lib64/python3.6/classicupgrade.py�get_testparm_var* s r# c @ s� e Zd ZdZdZejejd�Ze ddddd�e d dd dd�e dddd d�e ddddd�e ddddd�e dddddddgddd�gZ e ddd d!d"gd#d$d"d%�gZej � r�e je� e je� d&gZd+d)d*�Zd'S ),�cmd_domain_classicupgradez�Upgrade from Samba classic (NT4-like) database to Samba AD DC database. Specify either a directory with all Samba classic DC databases and state files (with --dbdir) or the testparm utility from your classic installation (with --testparm). z"%prog [options] <classic_smb_conf>)� sambaopts�versionoptsz--dbdir�stringZDIRz+Path to samba classic DC database directory)�type�metavar�helpz --testparm�PATHz�Path to samba classic DC testparm utility from the previous installation. This allows the default paths of the previous installation to be followedz--targetdirzCPath prefix where the new Samba 4.0 AD domain should be initialisedz-qz--quietzBe quiet� store_true)r* �actionz-vz --verbosez Be verbosez --dns-backendZchoicezNAMESERVER-BACKENDZSAMBA_INTERNALZBIND9_FLATFILEZ BIND9_DLZZNONEa The DNS server backend. SAMBA_INTERNAL is the builtin name server (default), BIND9_FLATFILE uses bind9 text database to store zone information, BIND9_DLZ uses samba4 AD to store zone information, NONE skips the DNS setup entirely (this DC will not be a DNS server))r( r) �choicesr* �defaultz--use-xattrs�yes�no�autoz [yes|no|auto]z�Define if we should use the native fs capabilities or a tdb file for storing attributes likes ntacl when --use-ntvfs is set. auto tries to make an intelligent guess based on the user rights and system capabilities)r( r. r) r* r/ r NFc C s� t jj|�std| ��|r6t jj|� r6td| ��|rTt jj|� rTtd| ��| rh| rhtd��| j||d�}|r�|r�|jd� d }|j� } tj� }|j r�|j d|j � |d k r�t jj|�s�t j|� d}|d kr�d }n�|dkr�| r�d }n�|�std��n�|dk�r�|j d � �r�|�r8tjt jj|�d�}n"tjt jjt jj| j d���d�}zHy"tjj| |jddt� d� d }W n tk �r� |jd� Y nX W d |j� X i }|�r�||d<