mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-08-14 15:05:00 -05:00
Add option --no-log for ipa-replica-conncheck script
When option is sued, ipa-replica-conncheck will not log into file https://fedorahosted.org/freeipa/ticket/5757 Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
This commit is contained in:
@@ -181,6 +181,8 @@ def parse_options():
|
|||||||
parser.add_option("-q", "--quiet", dest="quiet",
|
parser.add_option("-q", "--quiet", dest="quiet",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
default=False, help="Output only errors")
|
default=False, help="Output only errors")
|
||||||
|
parser.add_option("--no-log", dest="log_to_file", action="store_false",
|
||||||
|
default=True, help="Do not log into file")
|
||||||
|
|
||||||
options, args = parser.parse_args()
|
options, args = parser.parse_args()
|
||||||
safe_options = parser.get_safe_opts(options)
|
safe_options = parser.get_safe_opts(options)
|
||||||
@@ -212,7 +214,7 @@ def parse_options():
|
|||||||
def logging_setup(options):
|
def logging_setup(options):
|
||||||
log_file = None
|
log_file = None
|
||||||
|
|
||||||
if os.getegid() == 0:
|
if os.getegid() == 0 and options.log_to_file:
|
||||||
log_file = paths.IPAREPLICA_CONNCHECK_LOG
|
log_file = paths.IPAREPLICA_CONNCHECK_LOG
|
||||||
|
|
||||||
standard_logging_setup(log_file, debug=options.debug)
|
standard_logging_setup(log_file, debug=options.debug)
|
||||||
|
|||||||
Reference in New Issue
Block a user