Use relative path instead of absolute path for latest symlink
This maintains the intended functionality while simultaneously allowing to copy or move the folder somewhere else. Otherwise, if I copy /var/tmp/packstack elsewhere, the symlink will keep pointing to /var/tmp/packstack. Change-Id: I7da0af24dbccb14d1f7fb1d75079ac109e981882
This commit is contained in:
parent
d220fc0c93
commit
4c55410145
|
@ -75,7 +75,10 @@ if os.path.exists(LATEST_LOG_DIR):
|
|||
print ('Unable to delete symbol link for log dir %s.' % LATEST_LOG_DIR)
|
||||
|
||||
try:
|
||||
os.symlink(DIR_LOG, LATEST_LOG_DIR)
|
||||
# Extract folder name at /var/tmp/packstack/<VAR_DIR> and do a relative
|
||||
# symlink to /var/tmp/packstack/latest
|
||||
os.symlink(os.path.basename(VAR_DIR),
|
||||
os.path.join(PACKSTACK_VAR_DIR, 'latest'))
|
||||
except OSError:
|
||||
print ('Unable to create symbol link for log dir %s.' % LATEST_LOG_DIR)
|
||||
|
||||
|
|
Loading…
Reference in New Issue