Running ipa-replica-manage as non-root cause errors

Logging errors are printed out when ipa-replica-manage is run
as a non-root user. Log has been disabled in such case to
prevent such messages.

https://fedorahosted.org/freeipa/ticket/1046
This commit is contained in:
Martin Kosek 2011-03-21 17:18:30 +01:00
parent 2cbc6fd6a2
commit e96d0776f8

View File

@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import sys
import os
import getpass, ldap, re, krbV
import traceback, logging
@ -415,7 +416,13 @@ def main():
# Just initialize the environment. This is so the installer can have
# access to the plugin environment
api.bootstrap(in_server=True)
api_env = {}
api_env['in_server'] = True
if os.getegid() != 0:
api_env['log'] = None # turn off logging for non-root
api.bootstrap(**api_env)
api.finalize()
dirman_passwd = None