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>
DONT_USE_KERBEROS,
MUST_USE_KERBEROS,
)
-from samba.hostconfig import Hostconfig
import sys
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))
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."""
def _display_version(self, option, opt_str, arg, parser):
import samba
- print samba.version
+ print(samba.version)
sys.exit(0)