1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-27 07:42:04 +03:00

python: samba.getopt: Port module to Python 3 compatible form

Port samba.getopt module to Python 3 compatible form.

Remove unused and untested `get_hostconfig()` function. Andrew Bartlett
suggested this removal because it is the simpliest way how to break
a long dependency line of Python modules which have to be ported
at once.
More info: https://lists.samba.org/archive/samba-technical/2017-January/118150.html

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
Lumir Balhar
2017-01-17 11:03:17 +01:00
committed by Andrew Bartlett
parent da71c39f46
commit 9ada914f90

View File

@ -27,7 +27,6 @@ from samba.credentials import (
DONT_USE_KERBEROS,
MUST_USE_KERBEROS,
)
from samba.hostconfig import Hostconfig
import sys
@ -78,7 +77,7 @@ class SambaOptions(optparse.OptionGroup):
a = arg.split('=')
try:
self._lp.set(a[0], a[1])
except Exception, e:
except Exception as e:
raise optparse.OptionValueError(
"invalid --option option value %r: %s" % (arg, e))
@ -92,9 +91,6 @@ class SambaOptions(optparse.OptionGroup):
self._lp.load_default()
return self._lp
def get_hostconfig(self):
return Hostconfig(self.get_loadparm())
class VersionOptions(optparse.OptionGroup):
"""Command line option for printing Samba version."""
@ -106,7 +102,7 @@ class VersionOptions(optparse.OptionGroup):
def _display_version(self, option, opt_str, arg, parser):
import samba
print samba.version
print(samba.version)
sys.exit(0)