adtrustinstance: Make sure smb.conf exists

The 'net' command fails unless smb.conf exists. Touch
the file prior to any 'net' call to make sure we do not crash
for this very reason.

https://fedorahosted.org/freeipa/ticket/5687

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Tomas Babej
2016-02-26 14:28:26 +01:00
committed by Martin Basti
parent 6b747431a8
commit c1323f6b9d

View File

@@ -520,6 +520,11 @@ class ADTRUSTInstance(service.Service):
os.write(tmp_fd, conf)
os.close(tmp_fd)
# Workaround for: https://fedorahosted.org/freeipa/ticket/5687
# We make sure that paths.SMB_CONF file exists, hence touch it
with open(paths.SMB_CONF, 'a'):
os.utime(paths.SMB_CONF, None)
args = [paths.NET, "conf", "import", tmp_name]
try: