from samba.ndr import ndr_pack
from samba.kcc.graph_utils import verify_and_dot
-from samba import ldif_utils
+from samba.kcc import ldif_import_export
from samba.kcc.graph import setup_graph, get_spanning_tree_edges
from samba.kcc.graph import Vertex
:param ldif_file: path to the ldif file to import
"""
try:
- self.samdb = ldif_utils.ldif_to_samdb(dburl, lp, ldif_file,
- self.forced_local_dsa)
- except ldif_utils.LdifError, e:
+ self.samdb = ldif_import_export.ldif_to_samdb(dburl, lp, ldif_file,
+ self.forced_local_dsa)
+ except ldif_import_export.LdifError, e:
print e
return 1
return 0
:param ldif_file: output LDIF file name to create
"""
try:
- ldif_utils.samdb_to_ldif_file(self.samdb, dburl, lp, creds,
- ldif_file)
- except ldif_utils.LdifError, e:
+ ldif_import_export.samdb_to_ldif_file(self.samdb, dburl, lp, creds,
+ ldif_file)
+ except ldif_import_export.LdifError, e:
print e
return 1
return 0
-#
-# LDIF helper fucntions, originally from the samba_kcc tool
+# LDIF helper functions for the samba_kcc tool
#
# Copyright (C) Dave Craft 2011
# Copyright (C) Andrew Bartlett 2015
-# Unix SMB/CIFS implementation. Tests for graph_utils.py routines
+# Unix SMB/CIFS implementation. Tests for samba.kcc.ldif_import_export.
# Copyright (C) Andrew Bartlett 2015
#
# Written by Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-"""Tests for samba.ldif_utils"""
+"""Tests for samba.kcc.ldif_import_export"""
import samba
import os
from tempfile import mkdtemp
import samba.tests
-from samba import ldif_utils
+from samba.kcc import ldif_import_export
from samba import ldb
from samba.dcerpc import misc
from samba.auth import system_session
from samba.samdb import SamDB
from samba.dcerpc import drsuapi
-from samba import ldif_utils
+from samba.kcc import ldif_import_export
from samba.kcc.kcc_utils import *
from samba.kcc.graph import *
from samba.kcc.debug import *
:param ldif_file: path to the ldif file to import
"""
try:
- self.samdb = ldif_utils.ldif_to_samdb(dburl, lp, ldif_file,
- opts.forced_local_dsa)
- except ldif_utils.LdifError, e:
+ self.samdb = ldif_import_export.ldif_to_samdb(dburl, lp, ldif_file,
+ opts.forced_local_dsa)
+ except ldif_import_export.LdifError, e:
print e
return 1
return 0
:param ldif_file: output LDIF file name to create
"""
try:
- ldif_utils.samdb_to_ldif_file(self.samdb, dburl, lp, creds,
+ ldif_import_export.samdb_to_ldif_file(self.samdb, dburl, lp, creds,
ldif_file)
- except ldif_utils.LdifError, e:
+ except ldif_import_export.LdifError, e:
print e
return 1
return 0