Merge "Fix return code detection in plugin list generation"

This commit is contained in:
Jenkins 2016-05-16 06:41:29 +00:00 committed by Gerrit Code Review
commit 7cd7f0576b

View File

@ -44,16 +44,10 @@ def is_in_openstack_namespace(proj):
# stackforge, etc) # stackforge, etc)
return proj.startswith('openstack/') return proj.startswith('openstack/')
# Rather than returning a 404 for a nonexistent file, cgit delivers a # Check if this project has a plugin file
# 0-byte response to a GET request. It also does not provide a
# Content-Length in a HEAD response, so the way we tell if a file exists
# is to check the length of the entire GET response body.
def has_devstack_plugin(proj): def has_devstack_plugin(proj):
r = requests.get("https://git.openstack.org/cgit/%s/plain/devstack/plugin.sh" % proj) r = requests.get("https://git.openstack.org/cgit/%s/plain/devstack/plugin.sh" % proj)
if len(r.text) > 0: return r.status_code == 200
return True
else:
return False
logging.debug("Getting project list from %s" % url) logging.debug("Getting project list from %s" % url)
r = requests.get(url) r = requests.get(url)