scripts: Fix an issue in get_recent_deployments() due to relative paths.

We were checking for whether an item in the deployments directory
represents a directory but were using its relative path which was
causing a false value to be returned for all items irrespective of
their being a directory or not if the script was invoked from some
where other than the deployments directory.
This commit is contained in:
Harshit Bansal
2017-09-24 12:55:15 +00:00
committed by Tim Abbott
parent f010ed117b
commit a6caf30ca7

View File

@@ -189,7 +189,7 @@ def get_recent_deployments(threshold_days):
recent = set()
threshold_date = datetime.datetime.now() - datetime.timedelta(days=threshold_days)
for dir_name in os.listdir(DEPLOYMENTS_DIR):
if not os.path.isdir(dir_name):
if not os.path.isdir(os.path.join(DEPLOYMENTS_DIR, dir_name)):
# Skip things like uwsgi sockets.
continue
try: