Add debug option to ipa-replica-manage and remove references to api_env var.

https://pagure.io/freeipa/issue/7187

Reviewed-By: Felipe Barreto <fbarreto@redhat.com>
This commit is contained in:
Thorsten Scherf 2017-10-16 15:10:20 +02:00 committed by Felipe Barreto
parent 23a0453c4d
commit 28802b396f

View File

@ -86,6 +86,8 @@ def parse_options():
parser.add_option("-p", "--password", dest="dirman_passwd", help="Directory Manager password")
parser.add_option("-v", "--verbose", dest="verbose", action="store_true", default=False,
help="provide additional information")
parser.add_option("-d", "--debug", dest="debug", action="store_true", default=False,
help="provide additional debug information")
parser.add_option("-f", "--force", dest="force", action="store_true", default=False,
help="ignore some types of errors")
parser.add_option("-c", "--cleanup", dest="cleanup", action="store_true", default=False,
@ -1509,18 +1511,9 @@ def main(options, args):
elif not os.path.exists(paths.IPA_DEFAULT_CONF):
sys.exit("IPA is not configured on this system.")
# Just initialize the environment. This is so the installer can have
# access to the plugin environment
api_env = {'in_server' : True,
'verbose' : options.verbose,
}
if os.getegid() != 0:
api_env['log'] = None # turn off logging for non-root
api.bootstrap(
context='cli', confdir=paths.ETC_IPA,
in_server=True, verbose=options.verbose
in_server=True, verbose=options.verbose, debug=options.debug
)
api.finalize()