diff options
Diffstat (limited to 'build-gluster-org/scripts')
-rw-r--r-- | build-gluster-org/scripts/close-old-reviews.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/build-gluster-org/scripts/close-old-reviews.py b/build-gluster-org/scripts/close-old-reviews.py index 3db9843..72fbcca 100644 --- a/build-gluster-org/scripts/close-old-reviews.py +++ b/build-gluster-org/scripts/close-old-reviews.py @@ -3,6 +3,7 @@ import requests import json import os +import sys def get_unique_id(days=90, count=25): @@ -22,18 +23,19 @@ def get_unique_id(days=90, count=25): def close_reviews(oldest_id): for uid in oldest_id: + url = 'https://review.gluster.org/a/changes/glusterfs~master~{}/abandon'.format(uid) + data = {"message" : "This change has not had activity in 90 days." + "We're automatically closing this change.\n" + "Please re-open and get in touch with the component owners" + " if you are interested in merging this patch."} + username = os.environ.get('HTTP_USERNAME') + password = os.environ.get('HTTP_PASSWORD') + response = requests.post(url, auth=(username, password), json=data) try: - url = 'https://review.gluster.org/a/changes/glusterfs~master~{}/abandon'.format(uid) - data = {"message" : "This change has not had activity in 90 days." - "We're automatically closing this change.\n" - "Please re-open and get in touch with the component owners" - " if you are interested in merging this patch."} - username = os.environ.get('HTTP_USERNAME') - password = os.environ.get('HTTP_PASSWORD') - response = requests.post(url, auth('username', 'password'), json=data) response.raise_for_status() except Exception: print("Authentication error. Username or password is incorrect") + sys.exit(1) def main(): |