%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/samba/netcmd/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/samba/netcmd/__pycache__/sites.cpython-312.pyc

�

��d�.��F�ddlmZmZddlmZddlmZmZm	Z	m
Z
ddlmZm
Z
ddlmZGd�de�ZGd�d	e�ZGd
�de�ZGd�d
e�ZGd�de�ZGd�de�ZGd�de�ZGd�de�ZGd�de�ZGd�de	�ZGd�de	�Zy)�)�sites�subnetsN)�Command�CommandError�SuperCommand�Option)�Site�Subnet)�
ModelErrorc��eZdZdZdZejejejd�Z	e
dddedd�	�e
d
ddd
d��gZ		dd�Z
y)�cmd_sites_listzList sites.z%prog [options]��	sambaopts�versionopts�credopts�-H�--URL�%LDB URL for database or target server�URL�ldap_url��help�type�metavar�dest�--json�Output results in JSON format.�
output_format�store_const�json�rr�action�constNc�x�|j|||�}	tj|�D�cic]}|j|j	���}}|dk(r|j|�y|j�D] }|jj|�d���"ycc}w#t
$r}	t
|	��d}	~	wwxYw)Nr �
)�ldb_connectr	�query�cn�as_dictrr�
print_json�keys�outf�write)
�selfrrrrr�ldb�site�
sites_dict�es
          �4/usr/lib/python3/dist-packages/samba/netcmd/sites.py�runzcmd_sites_list.run1s������x��H�=��	"�&*�j�j��o�7�"��'�'�4�<�<�>�1�7�J�7��F�"��O�O�J�'�"���)�
-���	�	���4�&���,�
-��7���	"��q�/�!��	"�s(�B �"B�B �B � 	B9�)B4�4B9�NNNNN)�__name__�
__module__�__qualname__�__doc__�synopsis�options�SambaOptions�VersionOptions�CredentialsOptions�takes_optiongroupsr�str�
takes_optionsr4��r3r
r
sp��� �H��)�)��-�-��.�.���	�t�W�#J���Z�	9��x�>�#�M��	I��M�;?�,0�-rCr
c��eZdZdZdZdgZejejejd�Z
edddedd	�
�gZ
		d
d�Zy)�cmd_sites_viewzView one site.�%prog <site> [options]�sitenamerrrrrrrNc���|j|||�}	tj||��}|�t	d|�d���|j|j
��y#t$r}t	|��d}~wwxYw)N�r(�Site � not found.)r&r	�getrrr*r))	r.rGrrrrr/r0r2s	         r3r4zcmd_sites_view.runWsx�����x��H�=��	"��8�8�C�H�-�D�
�<���x�j��<�=�=�	
�������'���	"��q�/�!��	"���A�	A6�&A1�1A6�NNNN�r6r7r8r9r:�
takes_argsr;r<r=r>r?rr@rAr4rBrCr3rErEEsd���'�H���J��)�)��-�-��.�.���	�t�W�#J���Z�	9��M�
EI��(rCrEc��eZdZdZdZdgZejejejd�Z
edddedd	�
�gZ
		d
d�Zy)�cmd_sites_createzCreate a new site.rFrGrrrrr�HrNc	�|�|j|||�}|j�	tj||j	�|�|j�|jjd|z�y#tj$r/}|j�td|�dt|�����d}~wwxYw)NzError while creating site �	, error: zSite %s created !
)r&�transaction_startr�create_site�get_config_basedn�transaction_commit�SiteAlreadyExistsException�transaction_cancelrr@r,r-�r.rGrSrrr�samdbr2s        r3r4zcmd_sites_create.run{s���� � ��I�x�8��
���!�	3����e�U�%<�%<�%>��I��$�$�&�	
�	�	���-��8�9���/�/�	3��$�$�&�� (�#�a�&� 2�3�
3��	3���5A9�9B;�*B6�6B;rNrOrBrCr3rRrRisc���'�H���J��)�)��-�-��.�.���	�t�W�#J���S�	2��M�
>B��
:rCrRc��eZdZdZdZdgZejejejd�Z
edddedd	�
�gZ
		d
d�Zy)�cmd_sites_deletezDelete an existing site.rFrGrrrrrrSrNc	�|�|j|||�}|j�	tj||j	�|�|j�|jjd|z�y#tj$r/}|j�td|�dt|�����d}~wwxYw)NzError while removing site rUzSite %s removed!
)r&rVr�delete_siterXrY�
SiteExceptionr[rr@r,r-r\s        r3r4zcmd_sites_delete.run�s���� � ��I�x�8��
���!�	P����e�U�%<�%<�%>��I��$�$�&�	
�	�	���,�x�7�8���"�"�	P��$�$�&��=E�s�1�v�N�P�
P��	P�r^rNrOrBrCr3r`r`�sc��"�'�H���J��)�)��-�-��.�.���	�t�W�#J���S�	2��M�
>B��
9rCr`c��eZdZdZdZdgZejejejd�Z
edddedd	�
�eddd
dd��gZ
		dd�Zy)�cmd_sites_subnet_listz
List subnets.rFrGrrrrrrrrrrrr r!Nc�,�|j|||�}	tj||��}|�t	d|�d���	tj|t|j���D�
cic]}
|
j|
j���}}
|dk(r|j|�y|j�D] }
|jj|
�d���"y#t$r}	t	|	��d}	~	wwxYwcc}
w#t$r}	t	|	��d}	~	wwxYw)NrIrJrK)�site_objectr r%)r&r	rLrrr
r'r@�dnr(r)r*r+r,r-)r.rGrrrrrr/r0r2�subnet�subnets_dicts            r3r4zcmd_sites_subnet_list.run�s�����x��H�=��	"��8�8�C�H�-�D�
�<���x�j��<�=�=�	"�*0�,�,�s�CF�t�w�w�<�+Q�R� &�#�I�I�v�~�~�'7�7�R�L�R��F�"��O�O�L�)�&�+�+�-�
/���	�	���6�(�"�
�.�
/��'�	"��q�/�!��	"��R���	"��q�/�!��	"�s@�C�,C:�*"C5�C:�	C2�"C-�-C2�5C:�:	D�D�Dr5rOrBrCr3rere�sy���'�H���J��)�)��-�-��.�.���	�t�W�#J���Z�	9��x�>�#�M��	I��M�EI�,0�/rCrec��eZdZdZdZdgZejejejd�Z
edddedd	�
�gZ
		d
d�Zy)�cmd_sites_subnet_viewzView subnet details.�%prog <subnet> [options]�
subnetnamerrrrrrrNc���|j|||�}	tj||��}|�t	d|�d���|j|j
��y#t$r}t	|��d}~wwxYw)NrI�Subnet rK)r&r
rLrrr*r))	r.rnrrrrr/rir2s	         r3r4zcmd_sites_subnet_view.run�sy�����x��H�=��	"��Z�Z��
�3�F�
�>�����K�@�A�A�	
������(�)���	"��q�/�!��	"�rMrNrOrBrCr3rlrl�sd���)�H���J��)�)��-�-��.�.���	�t�W�#J���Z�	9��M�
GK��*rCrlc��eZdZdZdZddgZejejejd�Z
eddded	d
��gZ
		dd
�Zy)�cmd_sites_subnet_createzCreate a new subnet.�)%prog <subnet> <site-of-subnet> [options]rn�site_of_subnetrrrrrrSrNc�l�|j|||�}|j�	tj||j	�||�|j�|jjd|z�y#tj$r&}|j�td|�d|����d}~wwxYw)NzError while creating subnet �: zSubnet %s created !
)r&rVr�
create_subnetrXrY�SubnetExceptionr[rr,r-�	r.rnrtrSrrrr]r2s	         r3r4zcmd_sites_subnet_create.runs���� � ��I�x�8��
���!�	0��!�!�%��)@�)@�)B�J�"0�
2��$�$�&�	
�	�	���/�*�<�=���&�&�	0��$�$�&�� *�A� /�0�
0��	0�s�6A:�:B3�
!B.�.B3rNrOrBrCr3rrrrsh���:�H�� 0�1�J��)�)��-�-��.�.���	�t�W�#J���S�	2��M�
AE�'+�>rCrrc��eZdZdZdZdgZejejejd�Z
edddedd	�
�gZ
		d
d�Zy)�cmd_sites_subnet_deletezDelete an existing subnet.rmrnrrrrrrSrNc�j�|j|||�}|j�	tj||j	�|�|j�|jjd|z�y#tj$r&}|j�td|�d|����d}~wwxYw)NzError while removing subnet rUzSubnet %s removed!
)r&rVr�
delete_subnetrXrYrxr[rr,r-)r.rnrSrrrr]r2s        r3r4zcmd_sites_subnet_delete.run6s���� � ��I�x�8��
���!�	0��!�!�%��)@�)@�)B�J�O��$�$�&�	
�	�	���.��;�<���&�&�	0��$�$�&�� *�A� /�0�
0��	0�s�5A9�9B2�!B-�-B2rNrOrBrCr3r{r{$sd��$�)�H���J��)�)��-�-��.�.���	�t�W�#J���S�	2��M�
@D��
=rCr{c��eZdZdZdZddgZejejejd�Z
eddded	d
��gZ
		dd
�Zy)�cmd_sites_subnet_set_sitezAssign a subnet to a site.rsrnrtrrrrrrSrNc	�p�|j|||�}|j�	tj||j	�||�|j�td|�d|��|j��y#tj$r)}|j�td|�d|�d|����d}~wwxYw)NzError assigning subnet z	 to site rvrpz shifted to site )�file)r&rVr�set_subnet_siterXrYrxr[r�printr,rys	         r3r4zcmd_sites_subnet_set_site.runVs���� � ��I�x�8��
���!�	@��#�#�E�5�+B�+B�+D�$.��
@��$�$�&�	��N�,�37�9�9�	>���&�&�	@��$�$�&�� *�N�A� ?�@�
@��	@�s�6A9�9B5�$B0�0B5rNrOrBrCr3rrFsh��$�:�H�� 0�1�J��)�)��-�-��.�.���	�t�W�#J���S�	2��M�
AE�'+�>rCrc�R�eZdZdZe�e�e�e�e�d�Z	y)�cmd_sites_subnetzSubnet management subcommands.)�create�remove�list�viewzset-siteN)
r6r7r8r9rrr{rerlr�subcommandsrBrCr3r�r�hs*��(�)�+�)�+�%�'�%�'�-�/��KrCr�c�x�eZdZdZiZe�ed<e�ed<e�ed<e�ed<e	�ed<y)�	cmd_siteszSites management.r�r�r�r�riN)
r6r7r8r9r�r
rErRr`r�rBrCr3r�r�ssK����K�(�*�K���(�*�K���,�.�K���,�.�K���,�.�K��rCr�)�sambarr�samba.getopt�getoptr;�samba.netcmdrrrr�samba.netcmd.domain.modelsr	r
�%samba.netcmd.domain.models.exceptionsrr
rErRr`rerlrrr{rr�r�rBrCr3�<module>r�s���&!����4�<�#-�W�#-�L!(�W�!(�H:�w�:�D9�w�9�D//�G�//�d!*�G�!*�H>�g�>�B=�g�=�D>��>�D�|��/��/rC

Zerion Mini Shell 1.0