| |
@@ -1,7 +1,7 @@
|
| |
import kitchen.text.converters
|
| |
|
| |
import hubs.models
|
| |
- import httplib
|
| |
+ import requests
|
| |
|
| |
|
| |
def required(session, value):
|
| |
@@ -42,18 +42,14 @@
|
| |
|
| |
|
| |
def pagure_repo(session, value):
|
| |
- conn = httplib.HTTPSConnection("pagure.io")
|
| |
- conn.request("GET", "/%s" % value)
|
| |
- response = conn.getresponse()
|
| |
- if response.status == 200:
|
| |
+ response = requests.get("https://pagure.io/%s" % value, timeout=5)
|
| |
+ if response.status_code == 200:
|
| |
return value
|
| |
raise ValueError('Invalid pagure repo')
|
| |
|
| |
|
| |
def fedorahosted_project(session, value):
|
| |
- conn = httplib.HTTPSConnection("fedorahosted.org")
|
| |
- conn.request("GET", "/%s" % value)
|
| |
- response = conn.getresponse()
|
| |
- if response.status == 200:
|
| |
+ response = requests.get("https://fedorahosted.org/%s" % value, timeout=5)
|
| |
+ if response.status_code == 200:
|
| |
return value
|
| |
raise ValueError('Invalid fedorahosted project')
|
| |
Small fixes to make the code run on Python 3.