Log contents of files created or modified by IPAChangeConf

This will show the status of the files during an installation.
This is particularly important during a replica install where
default.conf gets written several times.

Fixes: https://pagure.io/freeipa/issue/7218

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
This commit is contained in:
Rob Crittenden 2017-11-09 17:50:45 -05:00 committed by Christian Heimes
parent 21b09522b5
commit 79432cbdc6

View File

@ -19,6 +19,7 @@
#
import fcntl
import logging
import os
import shutil
@ -27,6 +28,8 @@ import six
if six.PY3:
unicode = str
logger = logging.getLogger(__name__)
def openLocked(filename, perms):
fd = -1
try:
@ -506,6 +509,8 @@ class IPAChangeConf(object):
f.close()
except IOError:
pass
logger.debug("Updating configuration file %s", file)
logger.debug(output)
return True
def newConf(self, file, options, file_perms=0o644):
@ -541,6 +546,8 @@ class IPAChangeConf(object):
f.close()
except IOError:
pass
logger.debug("Writing configuration file %s", file)
logger.debug(output)
return True
@staticmethod