%PDF- %PDF-
Direktori : /lib/python3/dist-packages/samba/netcmd/__pycache__/ |
Current File : //lib/python3/dist-packages/samba/netcmd/__pycache__/ou.cpython-312.pyc |
� �I�d79 � �� � d dl mZ d dlZd dlmZ d dlmZmZm Z m Z d dlmZ d dl mZ G d� de� Z G d� d e� Z G d � de� Z G d� d e� Z G d� de� Z G d� de� Z G d� de � Zy)� N)�system_session)�Command�CommandError�Option�SuperCommand)�SamDB)� attrgetterc � � e Zd ZdZdZ edddedd�� gZd d gZe j e j e j d�Z dd �Zy)� cmd_renamea Rename an organizational unit. The name of the organizational units can be specified as a full DN or without the domainDN component. Examples: samba-tool ou rename 'OU=OrgUnit,DC=samdom,DC=example,DC=com' \ 'OU=NewNameOfOrgUnit,DC=samdom,DC=example,DC=com' samba-tool ou rename 'OU=OrgUnit' 'OU=NewNameOfOrgUnit' The examples show how an administrator would rename an ou 'OrgUnit' to 'NewNameOfOrgUnit'. The new DN would be 'OU=NewNameOfOrgUnit,DC=samdom,DC=example,DC=com' z'%prog <old_ou_dn> <new_ou_dn> [options]�-H�--URL�%LDB URL for database or target server�URL�H��help�type�metavar�dest� old_ou_dn� new_ou_dn�� sambaopts�credopts�versionoptsNc � � |j � }|j |d�� }t |t � ||�� } | j |� } | j |� } | j | dt j g �� } t | � d k( r| j j d |z � y | j | |� | j j d| �d |�d�� y # t $ r}t d|�d|��� �d }~ww xY w# t $ r}t d|�d|��� �d }~ww xY w# t $ r}t d| z |� �d }~ww xY w)NT��fallback_machine��url�session_info�credentials�lp�Invalid old_ou_dn "�": zInvalid new_ou_dn "� (objectclass=organizationalUnit)��base� expression�scope�attrsr �Unable to find ou "%s" zFailed to rename ou "%s"zRenamed ou "z" to "�" )�get_loadparm�get_credentialsr r �normalize_dn_in_domain� Exceptionr �search�ldb� SCOPE_BASE�len�outf�write�rename)�selfr r r r r r r# �creds�samdb�full_old_ou_dn�e�full_new_ou_dn�ress �1/usr/lib/python3/dist-packages/samba/netcmd/ou.py�runzcmd_rename.run? sU � � � #� #� %���(�(��d�(�C���!�.�*:�"'�B�0�� /�"�9�9�)�D�N� /�"�9�9�)�D�N� O��,�,�N�*L�%(�^�^�2� � ?�C� �3�x�1�}�� � ��� :�Y� F�G���L�L���8� � � ���~�7E�G� H��) � /�� )�1� .� /� /�� /�� � /�� )�1� .� /� /�� /�� � O��9�N�J�A�N�N�� O�sN �C% �D � AD) �0D) �% D�.C?�?D� D&�D!�!D&�) E�2E�E�NNNN��__name__� __module__�__qualname__�__doc__�synopsisr �str� takes_options� takes_args�options�SambaOptions�CredentialsOptions�VersionOptions�takes_optiongroupsrA � � r@ r r ! sl � � � 9�H� �t�W�#J���S� 2��M� �{�+�J��)�)��.�.��-�-��� BF� $�HrR r c � � e Zd ZdZdZ edddedd�� gZd d gZe j e j e j d�Z dd �Zy)�cmd_moveai Move an organizational unit. The name of the organizational units can be specified as a full DN or without the domainDN component. Examples: samba-tool ou move 'OU=OrgUnit,DC=samdom,DC=example,DC=com' \ 'OU=NewParentOfOrgUnit,DC=samdom,DC=example,DC=com' samba-tool ou rename 'OU=OrgUnit' 'OU=NewParentOfOrgUnit' The examples show how an administrator would move an ou 'OrgUnit' into the ou 'NewParentOfOrgUnit'. The ou 'OrgUnit' would become a child of the 'NewParentOfOrgUnit' ou. The new DN would be 'OU=OrgUnit,OU=NewParentOfOrgUnit,DC=samdom,DC=example,DC=com' z+%prog <old_ou_dn> <new_parent_dn> [options]r r r r r r r � new_parent_dnr Nc �, � |j � }|j |d�� }t |t � ||�� } | j |� } | j |� }t j | t | � � } | j t | � dz � | j |� | j | dt j g � � }t |� d k( r| j j! d| z � y | j# | | � | j j! d | �d|�d�� y # t $ r}t d|�d|��� �d }~ww xY w# t $ r}t d|�d|��� �d }~ww xY w# t $ r}t d| z |� �d }~ww xY w)NTr r r$ r% zInvalid new_parent_dn "� r&