summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-07-19 18:51:15 +0200
committerJelmer Vernooij <jelmer@samba.org>2009-07-19 18:51:15 +0200
commit478446f96dae1f42312b72fda4210f1300023e57 (patch)
tree7d69d854d2a09a2aec8644fc8a75953f91a257fa
parent8557d14f65212faceb3e7223818b34b8869a0470 (diff)
downloadsamba-478446f96dae1f42312b72fda4210f1300023e57.tar.gz
samba-478446f96dae1f42312b72fda4210f1300023e57.tar.bz2
samba-478446f96dae1f42312b72fda4210f1300023e57.zip
Remove unnecessary imports.
-rw-r--r--source4/scripting/python/samba/__init__.py1
-rw-r--r--source4/scripting/python/samba/getopt.py2
-rw-r--r--source4/scripting/python/samba/idmap.py2
-rw-r--r--source4/scripting/python/samba/provision.py5
-rw-r--r--source4/scripting/python/samba/samba3.py4
-rw-r--r--source4/scripting/python/samba/upgrade.py9
6 files changed, 9 insertions, 14 deletions
diff --git a/source4/scripting/python/samba/__init__.py b/source4/scripting/python/samba/__init__.py
index 131d1a3ac6..164803bb65 100644
--- a/source4/scripting/python/samba/__init__.py
+++ b/source4/scripting/python/samba/__init__.py
@@ -42,7 +42,6 @@ else:
import ldb
-import credentials
import glue
class Ldb(ldb.Ldb):
diff --git a/source4/scripting/python/samba/getopt.py b/source4/scripting/python/samba/getopt.py
index c12245f6c5..8b756b2d6f 100644
--- a/source4/scripting/python/samba/getopt.py
+++ b/source4/scripting/python/samba/getopt.py
@@ -20,7 +20,7 @@
"""Support for parsing Samba-related command-line options."""
import optparse
-from credentials import Credentials, AUTO_USE_KERBEROS, DONT_USE_KERBEROS, MUST_USE_KERBEROS
+from credentials import Credentials, DONT_USE_KERBEROS, MUST_USE_KERBEROS
from hostconfig import Hostconfig
__docformat__ = "restructuredText"
diff --git a/source4/scripting/python/samba/idmap.py b/source4/scripting/python/samba/idmap.py
index f8eeb18925..ee79be1af9 100644
--- a/source4/scripting/python/samba/idmap.py
+++ b/source4/scripting/python/samba/idmap.py
@@ -23,8 +23,6 @@
__docformat__ = "restructuredText"
import samba
-import glue
-import ldb
class IDmapDB(samba.Ldb):
"""The IDmap database."""
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py
index 8f57105224..8a7ed6a86e 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -38,13 +38,12 @@ import registry
import samba
from auth import system_session
from samba import version, Ldb, substitute_var, valid_netbios_name, check_all_substituted, \
- DS_BEHAVIOR_WIN2000, DS_BEHAVIOR_WIN2003_INTERIM, DS_BEHAVIOR_WIN2003, DS_BEHAVIOR_WIN2008
+ DS_BEHAVIOR_WIN2008
from samba.samdb import SamDB
from samba.idmap import IDmapDB
from samba.dcerpc import security
import urllib
-from ldb import SCOPE_SUBTREE, SCOPE_ONELEVEL, SCOPE_BASE, LdbError, \
- timestring, CHANGETYPE_MODIFY, CHANGETYPE_NONE
+from ldb import SCOPE_SUBTREE, LdbError, timestring
from ms_schema import read_ms_schema
__docformat__ = "restructuredText"
diff --git a/source4/scripting/python/samba/samba3.py b/source4/scripting/python/samba/samba3.py
index c8ddbc8864..179efa2700 100644
--- a/source4/scripting/python/samba/samba3.py
+++ b/source4/scripting/python/samba/samba3.py
@@ -502,7 +502,7 @@ TDBSAM_USER_PREFIX = "USER_"
class LdapSam(object):
"""Samba 3 LDAP passdb backend reader."""
def __init__(self, url):
- self.ldap_url = ldap_url
+ self.ldap_url = url
class TdbSam(TdbDatabase):
@@ -692,7 +692,7 @@ class ParamFile(object):
(k, v) = l.split("=", 1)
self._sections[section][self._sanitize_name(k)] = v
else:
- raise Error("Unable to parser line %d: %r" % (i+1,l))
+ raise Exception("Unable to parser line %d: %r" % (i+1,l))
def get(self, param, section=None):
"""Return the value of a parameter.
diff --git a/source4/scripting/python/samba/upgrade.py b/source4/scripting/python/samba/upgrade.py
index 0c83604e82..81945525e6 100644
--- a/source4/scripting/python/samba/upgrade.py
+++ b/source4/scripting/python/samba/upgrade.py
@@ -9,17 +9,16 @@
__docformat__ = "restructuredText"
-from provision import findnss, provision, FILL_DRS
+from provision import provision, FILL_DRS
import grp
import ldb
import time
import pwd
-import uuid
import registry
from samba import Ldb
-from samba.samdb import SamDB
+from samba.param import LoadParm
-def import_sam_policy(samldb, samba3_policy, domaindn):
+def import_sam_policy(samldb, policy, dn):
"""Import a Samba 3 policy database."""
samldb.modify_ldif("""
dn: %s
@@ -394,7 +393,7 @@ def upgrade_smbconf(oldconf,mark):
kept in the new configuration as "samba3:<name>"
"""
data = oldconf.data()
- newconf = param_init()
+ newconf = LoadParm()
for s in data:
for p in data[s]: