Merge "Logs symlinks creation fixed"

This commit is contained in:
Jenkins 2017-01-12 17:29:14 +00:00 committed by Gerrit Code Review
commit 9e91ffe62b
1 changed files with 1 additions and 2 deletions

View File

@ -62,13 +62,12 @@ def prepare_syslog_dir(node, prefix=settings.SYSLOG_DIR):
try:
# rename bootstrap directory into fqdn
subprocess.check_call(["/usr/bin/pkill", "-STOP", "rsyslog"])
if os.path.islink(old):
logger.debug("Old %s exists and it is link. "
"Trying to unlink", old)
os.unlink(old)
if os.path.isdir(old):
subprocess.check_call(["/usr/bin/pkill", "-STOP", "rsyslog"])
logger.debug("Old %s exists and it is directory. "
"Trying to rename into %s", old, new)
os.rename(old, new)