diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2010-11-28 13:37:31 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2010-11-28 17:23:27 +0100 |
commit | 979d298b0d6e5692f606a5bfe21a64d1ecce5613 (patch) | |
tree | 7104fb84f803278f4bc8e2d2ac6abd28440a2ee9 | |
parent | 28b509579df99ee576d5353eada31cd58aaa2508 (diff) | |
download | samba-979d298b0d6e5692f606a5bfe21a64d1ecce5613.tar.gz samba-979d298b0d6e5692f606a5bfe21a64d1ecce5613.tar.bz2 samba-979d298b0d6e5692f606a5bfe21a64d1ecce5613.zip |
samba.getopt: Fix missing import of sys.
-rw-r--r-- | source4/scripting/python/samba/getopt.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/source4/scripting/python/samba/getopt.py b/source4/scripting/python/samba/getopt.py index 8104faf62e..a5a3392984 100644 --- a/source4/scripting/python/samba/getopt.py +++ b/source4/scripting/python/samba/getopt.py @@ -19,17 +19,23 @@ """Support for parsing Samba-related command-line options.""" +__docformat__ = "restructuredText" + import optparse, os -from credentials import Credentials, DONT_USE_KERBEROS, MUST_USE_KERBEROS -from hostconfig import Hostconfig -import samba +from samba.credentials import ( + Credentials, + DONT_USE_KERBEROS, + MUST_USE_KERBEROS, + ) +from samba.hostconfig import Hostconfig +import sys -__docformat__ = "restructuredText" class SambaOptions(optparse.OptionGroup): """General Samba-related command line options.""" + def __init__(self, parser): - import os, param + from samba.param import LoadParm optparse.OptionGroup.__init__(self, parser, "Samba Common Options") self.add_option("-s", "--configfile", action="callback", type=str, metavar="FILE", help="Configuration file", @@ -44,7 +50,7 @@ class SambaOptions(optparse.OptionGroup): type=str, metavar="REALM", help="set the realm name", callback=self._set_realm) self._configfile = None - self._lp = param.LoadParm() + self._lp = LoadParm() def get_loadparm_path(self): """Return the path to the smb.conf file specified on the command line. """ @@ -85,11 +91,11 @@ class VersionOptions(optparse.OptionGroup): def __init__(self, parser): optparse.OptionGroup.__init__(self, parser, "Version Options") self.add_option("--version", action="callback", - callback=self._display_version, + callback=self._display_version, help="Display version number") def _display_version(self, option, opt_str, arg, parser): - import samba, sys + import samba print samba.version sys.exit(0) |