mirror of
https://github.com/samba-team/samba.git
synced 2025-07-25 00:59:11 +03:00
Use CommandError exception to deal with problems during net commands.
This commit is contained in:
committed by
Jelmer Vernooij
parent
eaf4a9afb2
commit
732a7630e9
@ -2,17 +2,17 @@
|
||||
|
||||
# Samba-specific bits for optparse
|
||||
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
|
||||
#
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
@ -30,7 +30,7 @@ class SambaOptions(optparse.OptionGroup):
|
||||
def __init__(self, parser):
|
||||
optparse.OptionGroup.__init__(self, parser, "Samba Common Options")
|
||||
self.add_option("-s", "--configfile", action="callback",
|
||||
type=str, metavar="FILE", help="Configuration file",
|
||||
type=str, metavar="FILE", help="Configuration file",
|
||||
callback=self._load_configfile)
|
||||
self._configfile = None
|
||||
|
||||
@ -73,15 +73,15 @@ class CredentialsOptions(optparse.OptionGroup):
|
||||
help="DN to use for a simple bind")
|
||||
self.add_option("--password", metavar="PASSWORD", action="callback",
|
||||
help="Password", type=str, callback=self._set_password)
|
||||
self.add_option("-U", "--username", metavar="USERNAME",
|
||||
self.add_option("-U", "--username", metavar="USERNAME",
|
||||
action="callback", type=str,
|
||||
help="Username", callback=self._parse_username)
|
||||
self.add_option("-W", "--workgroup", metavar="WORKGROUP",
|
||||
self.add_option("-W", "--workgroup", metavar="WORKGROUP",
|
||||
action="callback", type=str,
|
||||
help="Workgroup", callback=self._parse_workgroup)
|
||||
self.add_option("-N", "--no-pass", action="store_true",
|
||||
help="Don't ask for a password")
|
||||
self.add_option("-k", "--kerberos", metavar="KERBEROS",
|
||||
self.add_option("-k", "--kerberos", metavar="KERBEROS",
|
||||
action="callback", type=str,
|
||||
help="Use Kerberos", callback=self._set_kerberos)
|
||||
self.creds = Credentials()
|
||||
|
Reference in New Issue
Block a user