Skip to content

Commit

Permalink
scripts: Fix an issue in purge-old-deployments script.
Browse files Browse the repository at this point in the history
We were not including the real path of the symlinks due to which we
were incorrectly deleting deployments pointed by last/current/next.
  • Loading branch information
HarshitOnGitHub authored and timabbott committed Oct 31, 2017
1 parent 493529d commit 8c9ea94
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/lib/zulip_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ def get_recent_deployments(threshold_days):
except ValueError:
# Always include deployments whose name is not in the format of a timestamp.
recent.add(target_dir)
# If it is a symlink then include the target as well.
if os.path.islink(target_dir):
recent.add(os.path.realpath(target_dir))
if os.path.exists("/root/zulip"):
recent.add("/root/zulip")
return recent
Expand Down

0 comments on commit 8c9ea94

Please sign in to comment.