summaryrefslogtreecommitdiffstats
path: root/build-gluster-org
diff options
context:
space:
mode:
authordeepshikhaaa <deepshikhakhandelwal8@gmail.com>2017-11-21 18:07:18 +0530
committerdeepshikhaaa <deepshikhakhandelwal8@gmail.com>2017-11-21 18:07:18 +0530
commit405980685e49b722f7d30338b0e84eea7456e145 (patch)
treea924374b6a02847061db2674bee77ade62efcd79 /build-gluster-org
parentcfe7cb1431dfb3e0c2bf7374038a74890ca1f7f0 (diff)
Fix the errors in requests.post function
Change-Id: I893b44777318cbbb753d7e6656dd524640c5ac9a
Diffstat (limited to 'build-gluster-org')
-rw-r--r--build-gluster-org/scripts/close-old-reviews.py18
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():