mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
s4-python: rename samba.glue to samba._glue to indicate it's private.
This commit is contained in:
parent
cc6e2b8a81
commit
a35d876537
@ -15,7 +15,7 @@ from samba.auth import system_session
|
||||
from ldb import (SCOPE_BASE, LdbError, ERR_NO_SUCH_OBJECT, Message,
|
||||
MessageElement, Dn, FLAG_MOD_REPLACE)
|
||||
from samba import Ldb
|
||||
from samba import glue
|
||||
from samba import _glue
|
||||
|
||||
from subunit.run import SubunitTestRunner
|
||||
import unittest
|
||||
@ -68,7 +68,7 @@ class UrgentReplicationTests(unittest.TestCase):
|
||||
"description":"nonurgenttest description"});
|
||||
|
||||
# urgent replication should not be enabled when creating
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
# urgent replication should not be enabled when modifying
|
||||
@ -77,12 +77,12 @@ class UrgentReplicationTests(unittest.TestCase):
|
||||
m["description"] = MessageElement("new description", FLAG_MOD_REPLACE,
|
||||
"description")
|
||||
ldb.modify(m)
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
# urgent replication should not be enabled when deleting
|
||||
self.delete_force(self.ldb, "cn=nonurgenttest,cn=users," + self.base_dn)
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
|
||||
@ -105,7 +105,7 @@ instanceType: 4
|
||||
systemFlags: 33554432""", ["relax:0"]);
|
||||
|
||||
# urgent replication should be enabled when creation
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, "cn=Configuration," + self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, "cn=Configuration," + self.base_dn)
|
||||
self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
# urgent replication should NOT be enabled when modifying
|
||||
@ -114,12 +114,12 @@ systemFlags: 33554432""", ["relax:0"]);
|
||||
m["options"] = MessageElement("0", FLAG_MOD_REPLACE,
|
||||
"options")
|
||||
ldb.modify(m)
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, "cn=Configuration," + self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, "cn=Configuration," + self.base_dn)
|
||||
self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
# urgent replication should be enabled when deleting
|
||||
self.delete_force(self.ldb, "cn=NTDS Settings test,cn=test server,cn=Servers,cn=Default-First-Site-Name,cn=Sites,cn=Configuration," + self.base_dn)
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, "cn=Configuration," + self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, "cn=Configuration," + self.base_dn)
|
||||
self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
self.delete_force(self.ldb, "cn=test server,cn=Servers,cn=Default-First-Site-Name,cn=Sites,cn=Configuration," + self.base_dn)
|
||||
@ -139,7 +139,7 @@ systemFlags: 33554432""", ["relax:0"]);
|
||||
"systemFlags": "1"});
|
||||
|
||||
# urgent replication should be enabled when creating
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, "cn=Configuration," + self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, "cn=Configuration," + self.base_dn)
|
||||
self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
# urgent replication should NOT be enabled when modifying
|
||||
@ -148,13 +148,13 @@ systemFlags: 33554432""", ["relax:0"]);
|
||||
m["systemFlags"] = MessageElement("0", FLAG_MOD_REPLACE,
|
||||
"systemFlags")
|
||||
ldb.modify(m)
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, "cn=Configuration," + self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, "cn=Configuration," + self.base_dn)
|
||||
self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
|
||||
# urgent replication should be enabled when deleting
|
||||
self.delete_force(self.ldb, "cn=test crossRef,CN=Partitions,CN=Configuration," + self.base_dn)
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, "cn=Configuration," + self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, "cn=Configuration," + self.base_dn)
|
||||
self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
|
||||
@ -183,7 +183,7 @@ name: test attributeSchema
|
||||
systemFlags: 0""", ["relax:0"]);
|
||||
|
||||
# urgent replication should be enabled when creating
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, "cn=Schema,cn=Configuration," + self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, "cn=Schema,cn=Configuration," + self.base_dn)
|
||||
self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
except LdbError:
|
||||
@ -195,7 +195,7 @@ systemFlags: 0""", ["relax:0"]);
|
||||
m["lDAPDisplayName"] = MessageElement("updated test attributeSchema", FLAG_MOD_REPLACE,
|
||||
"lDAPDisplayName")
|
||||
ldb.modify(m)
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, "cn=Schema,cn=Configuration," + self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, "cn=Schema,cn=Configuration," + self.base_dn)
|
||||
self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
|
||||
@ -226,7 +226,7 @@ systemFlags: 16
|
||||
defaultHidingValue: TRUE""", ["relax:0"]);
|
||||
|
||||
# urgent replication should be enabled when creating
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, "cn=Schema,cn=Configuration," + self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, "cn=Schema,cn=Configuration," + self.base_dn)
|
||||
self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
except LdbError:
|
||||
@ -238,7 +238,7 @@ defaultHidingValue: TRUE""", ["relax:0"]);
|
||||
m["lDAPDisplayName"] = MessageElement("updated test classSchema", FLAG_MOD_REPLACE,
|
||||
"lDAPDisplayName")
|
||||
ldb.modify(m)
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, "cn=Schema,cn=Configuration," + self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, "cn=Schema,cn=Configuration," + self.base_dn)
|
||||
self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
|
||||
@ -255,7 +255,7 @@ defaultHidingValue: TRUE""", ["relax:0"]);
|
||||
|
||||
|
||||
# urgent replication should be enabled when creating
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
# urgent replication should be enabled when modifying
|
||||
@ -264,12 +264,12 @@ defaultHidingValue: TRUE""", ["relax:0"]);
|
||||
m["currentValue"] = MessageElement("yyyyyyyy", FLAG_MOD_REPLACE,
|
||||
"currentValue")
|
||||
ldb.modify(m)
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
# urgent replication should NOT be enabled when deleting
|
||||
self.delete_force(self.ldb, "cn=test secret,cn=System," + self.base_dn)
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
|
||||
@ -288,7 +288,7 @@ isCriticalSystemObject: TRUE
|
||||
rIDAvailablePool: 133001-1073741823""", ["relax:0"])
|
||||
|
||||
# urgent replication should be enabled when creating
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
# urgent replication should be enabled when modifying
|
||||
@ -297,12 +297,12 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"])
|
||||
m["systemFlags"] = MessageElement("0", FLAG_MOD_REPLACE,
|
||||
"systemFlags")
|
||||
ldb.modify(m)
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
# urgent replication should NOT be enabled when deleting
|
||||
self.delete_force(self.ldb, "CN=RID Manager test,CN=System," + self.base_dn)
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
|
||||
@ -320,7 +320,7 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"])
|
||||
"description":"urgent attributes test description"});
|
||||
|
||||
# urgent replication should NOT be enabled when creating
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
# urgent replication should be enabled when modifying userAccountControl
|
||||
@ -329,7 +329,7 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"])
|
||||
m["userAccountControl"] = MessageElement("0", FLAG_MOD_REPLACE,
|
||||
"userAccountControl")
|
||||
ldb.modify(m)
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
# urgent replication should be enabled when modifying lockoutTime
|
||||
@ -338,7 +338,7 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"])
|
||||
m["lockoutTime"] = MessageElement("1", FLAG_MOD_REPLACE,
|
||||
"lockoutTime")
|
||||
ldb.modify(m)
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
# urgent replication should be enabled when modifying pwdLastSet
|
||||
@ -347,7 +347,7 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"])
|
||||
m["pwdLastSet"] = MessageElement("1", FLAG_MOD_REPLACE,
|
||||
"pwdLastSet")
|
||||
ldb.modify(m)
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
# urgent replication should NOT be enabled when modifying a not-urgent
|
||||
@ -357,12 +357,12 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"])
|
||||
m["description"] = MessageElement("updated urgent attributes test description",
|
||||
FLAG_MOD_REPLACE, "description")
|
||||
ldb.modify(m)
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
# urgent replication should NOT be enabled when deleting
|
||||
self.delete_force(self.ldb, "cn=user UrgAttr test,cn=users," + self.base_dn)
|
||||
res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
res = _glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
|
||||
self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
|
||||
|
||||
|
||||
|
@ -15,13 +15,13 @@ PRIVATE_DEPENDENCIES = LIBNDR
|
||||
|
||||
python_uuid_OBJ_FILES = $(pyscriptsrcdir)/uuidmodule.o
|
||||
|
||||
[PYTHON::python_glue]
|
||||
LIBRARY_REALNAME = samba/glue.$(SHLIBEXT)
|
||||
[PYTHON::python__glue]
|
||||
LIBRARY_REALNAME = samba/_glue.$(SHLIBEXT)
|
||||
PRIVATE_DEPENDENCIES = LIBNDR LIBLDB SAMDB CREDENTIALS pyldb python_dcerpc_misc python_dcerpc_security pyauth pyldb_util pyparam_util
|
||||
|
||||
python_glue_OBJ_FILES = $(pyscriptsrcdir)/pyglue.o
|
||||
python__glue_OBJ_FILES = $(pyscriptsrcdir)/pyglue.o
|
||||
|
||||
$(python_glue_OBJ_FILES): CFLAGS+=-I$(ldbsrcdir)
|
||||
$(python__glue_OBJ_FILES): CFLAGS+=-I$(ldbsrcdir)
|
||||
|
||||
_PY_FILES = $(shell find $(pyscriptsrcdir)/samba -type f -name "*.py")
|
||||
|
||||
|
@ -309,13 +309,13 @@ static PyMethodDef py_misc_methods[] = {
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
void initglue(void)
|
||||
void init_glue(void)
|
||||
{
|
||||
PyObject *m;
|
||||
|
||||
debug_setup_talloc_log();
|
||||
|
||||
m = Py_InitModule3("glue", py_misc_methods,
|
||||
m = Py_InitModule3("_glue", py_misc_methods,
|
||||
"Python bindings for miscellaneous Samba functions.");
|
||||
if (m == NULL)
|
||||
return;
|
||||
|
@ -43,7 +43,7 @@ else:
|
||||
|
||||
import ldb
|
||||
import dsdb
|
||||
import glue
|
||||
import _glue
|
||||
from samba._ldb import Ldb as _Ldb
|
||||
|
||||
class Ldb(_Ldb):
|
||||
@ -275,13 +275,13 @@ class Ldb(_Ldb):
|
||||
dsdb.samdb_get_domain_sid(self)
|
||||
|
||||
def set_schema_from_ldif(self, pf, df):
|
||||
glue.dsdb_set_schema_from_ldif(self, pf, df)
|
||||
_glue.dsdb_set_schema_from_ldif(self, pf, df)
|
||||
|
||||
def set_schema_from_ldb(self, ldb):
|
||||
glue.dsdb_set_schema_from_ldb(self, ldb)
|
||||
_glue.dsdb_set_schema_from_ldb(self, ldb)
|
||||
|
||||
def write_prefixes_from_schema(self):
|
||||
glue.dsdb_write_prefixes_from_schema_to_ldb(self)
|
||||
_glue.dsdb_write_prefixes_from_schema_to_ldb(self)
|
||||
|
||||
def convert_schema_to_openldap(self, target, mapping):
|
||||
return dsdb.dsdb_convert_schema_to_openldap(self, target, mapping)
|
||||
@ -397,8 +397,8 @@ def ensure_external_module(modulename, location):
|
||||
sys.modules[modulename] = __import__(
|
||||
"samba.external.%s" % modulename, fromlist=["samba.external"])
|
||||
|
||||
version = glue.version
|
||||
interface_ips = glue.interface_ips
|
||||
set_debug_level = glue.set_debug_level
|
||||
unix2nttime = glue.unix2nttime
|
||||
generate_random_password = glue.generate_random_password
|
||||
version = _glue.version
|
||||
interface_ips = _glue.interface_ips
|
||||
set_debug_level = _glue.set_debug_level
|
||||
unix2nttime = _glue.unix2nttime
|
||||
generate_random_password = _glue.generate_random_password
|
||||
|
@ -22,7 +22,7 @@
|
||||
import optparse
|
||||
from credentials import Credentials, DONT_USE_KERBEROS, MUST_USE_KERBEROS
|
||||
from hostconfig import Hostconfig
|
||||
import glue
|
||||
import samba
|
||||
|
||||
__docformat__ = "restructuredText"
|
||||
|
||||
@ -60,7 +60,7 @@ class SambaOptions(optparse.OptionGroup):
|
||||
else:
|
||||
lp.load_default()
|
||||
if self._debuglevel:
|
||||
glue.set_debug_level(self._debuglevel)
|
||||
samba.set_debug_level(self._debuglevel)
|
||||
return lp
|
||||
|
||||
def get_hostconfig(self):
|
||||
|
@ -24,7 +24,7 @@ bld.SAMBA_PYTHON('python_uuid',
|
||||
bld.SAMBA_PYTHON('python_glue',
|
||||
source='pyglue.c',
|
||||
deps='LIBNDR ldb SAMDB CREDENTIALS pyldb python_dcerpc_misc python_dcerpc_security pyauth pyldb_util pyparam_util',
|
||||
realname='samba/glue.so'
|
||||
realname='samba/_glue.so'
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user