Anons79 Mini Shell

Directory : /proc/self/root/lib/python2.7/site-packages/ansible/module_utils/
Upload File :
Current File : //proc/self/root/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyc

�
�Udac@s�dZddlZddddddgZiZd	�Zd
�Zd�Zd�Zd
�Zd�Z	d�Z
d�Zdd�Zddd�Zd�Zd�Zdd�Zdd�Zd�ZdS(s�Univention Corporate Server (UCS) access module.

Provides the following functions for working with an UCS server.

  - ldap_search(filter, base=None, attr=None)
    Search the LDAP via Univention's LDAP wrapper (ULDAP)

  - config_registry()
    Return the UCR registry object

  - base_dn()
    Return the configured Base DN according to the UCR

  - uldap()
    Return a handle to the ULDAP LDAP wrapper

  - umc_module_for_add(module, container_dn, superordinate=None)
    Return a UMC module for creating a new object of the given type

  - umc_module_for_edit(module, object_dn, superordinate=None)
    Return a UMC module for editing an existing object of the given type


Any other module is not part of the "official" API and may change at any time.
i����Ntldap_searchtconfig_registrytbase_dntuldaptumc_module_for_addtumc_module_for_editcCsddl}|S(Ni����(tldap(t	orig_ldap((sG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pytldap_moduleKscCs)|tkrt|S|�t|<t|S(N(t_singletons(tnametconstructor((sG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyt
_singletonPs
cCsd�}td|�S(NcSs)ddl}|jj�}|j�|S(Ni����(tunivention.config_registryRtConfigRegistrytload(t
univentiontucr((sG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyt	constructYs
R(R(R((sG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyRWs	cCst�dS(Ns	ldap/base(R(((sG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyRbscCsd�}td|�S(s+Return a configured univention uldap objectcSs�y%tdd�}djt��}Wn-tk
rTtdd�}t�d}nX|j�}tjdd|�}ddl}|j	j
jd	t�d
dt�d|d
|dd�S(Ns/etc/ldap.secrettrscn=admin,{0}s/etc/machine.secretsldap/hostdns
ti����thostsldap/mastertbasetbinddntbindpwt	start_tlsi(topentformatRtIOErrorRtreadlinetretsubtunivention.admin.uldaptadminRtaccess(tsecret_filetbind_dntpwd_linetpwdR((sG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyRis

	R(R(R((sG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyRfs	cCsd�}td|�S(NcSsddl}|jjj�S(Ni����(tunivention.admin.configR!tconfig(R((sG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyR�sR((R(R((sG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyR(s	cCsd�}td|�S(NcSs ddl}|jjj�tS(Ni����(tunivention.admin.modulesR!tmodulestupdatetTrue(R((sG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyR�stmodules_initialized(R(R((sG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pytinit_modules�s	cCsd�}td|�S(NcSs"ddl}|jjjt��S(Ni����(R R!RtpositionR(R((sG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyR�stposition_base_dn(R(R((sG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyR0�s	icCs)|jd�}g|d|+dj|�S(Nt,i(tsplittjoin(tdntcounttdn_array((sG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pytldap_dn_tree_parent�s
ccs�|dkrt�}nt�jjj|t�jd|d|�}xytr�t�jjj|dd�\}}|s|Pn|t�j	kr�PqH|t�j
krHx|D]}|Vq�WqHqHWt�jjj|�dS(sOReplaces uldaps search and uses a generator.
    !! Arguments are not the same.t	filterstrtattrlisttalliN(tNoneRRtlotsearchRt
SCOPE_SUBTREER,tresulttRES_SEARCH_RESULTtRES_SEARCH_ENTRYtabandon(tfilterRtattrtmsgidtresult_typetresult_datatres((sG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyR�s"		$
cs �fd�}td�|�S(soReturns an initialized UMC module, identified by the given name.

    The module is a module specification according to the udm commandline.
    Example values are:
    * users/user
    * shares/share
    * groups/group

    If the module does not exist, a KeyError is raised.

    The modules are cached, so they won't be re-initialized
    in subsequent calls.
    csKddl}t�|jjj��}|jjjt�t�|�|S(Ni����(R)R.R!R*tgettinitRR0(Rtmodule(tmodule_name_(sG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyR�s
s	module/%s(R(RLR((RLsG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pytmodule_by_name�scCsddl}|jjS(s�Convenience accessor for getting univention.admin.objects.

    This implements delayed importing, so the univention.* modules
    are not loaded until this function is called.
    i����N(tunivention.adminR!tobjects(R((sG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pytget_umc_admin_objects�scCsQt|�}t�}|j|�|jt�t�|d|�}|j�|S(sPReturns an UMC module object prepared for creating a new entry.

    The module is a module specification according to the udm commandline.
    Example values are:
        * users/user
        * shares/share
        * groups/group

    The container_dn MUST be the dn of the container (not of the object to
    be created itself!).
    t
superordinate(RMR0tsetDntobjectR(RR(RKtcontainer_dnRQtmodR/tobj((sG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyR�s	
!
c
Cslt|�}t�}t�}|jt|��|j|t�t�d|d|d|�}|j�|S(s4Returns an UMC module object prepared for editing an existing entry.

   The module is a module specification according to the udm commandline.
   Example values are:
       * users/user
       * shares/share
       * groups/group

   The object_dn MUST be the dn of the object itself, not the container!
   R/RQR4(	RMRPR0RRR7RIR(RR(RKt	object_dnRQRUROR/RV((sG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyR�s				
cCs�ddljj}|jd�s-t��nyMt|�}td|�}|jd�djd�d|d	<d
|d<Wn[|jk
r�t	|�td|�}|jd�djd�d|d	<d
|d<nXdS(s7Create a container and if needed the parents containersi����Nscn=scontainer/cnR1it=iR
scontainer created by importtdescription(
tunivention.admin.uexceptionsR!tuexceptionst
startswithtAssertionErrorR7RR2t	ldapErrortcreate_containers_and_parents(RTtuexcptparentRV((sG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyR_s"	$
	$(t__doc__Rt__all__R	RRRRRR(R.R0R7R;RRMRPRRR_(((sG/usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyt<module>9s.											


Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]