From 53f6158bdd7bfcb69319869ee9bc96ccc2975d6b Mon Sep 17 00:00:00 2001 From: Armando Migliaccio Date: Fri, 26 Aug 2016 12:23:37 -0700 Subject: [PATCH] Make Neutron script pull all Stadium projects Change-Id: I2d9034a31a2492a5723db6d8e10e495b20696db6 --- bin/neutron | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/bin/neutron b/bin/neutron index d70ffc5..aa48576 100755 --- a/bin/neutron +++ b/bin/neutron @@ -11,8 +11,11 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. + import argparse import sys +import urllib2 +import yaml from launchpadlib.launchpad import Launchpad @@ -113,6 +116,13 @@ def write_queries_for_project(f, project, milestone): write_section(f, section_name, query) +def get_stadium_projects(): + data = urllib2.urlopen("http://git.openstack.org/cgit/openstack/" + "governance/plain/reference/projects.yaml") + governance = yaml.load(data) + return governance["neutron"]["deliverables"].keys() + + parser = argparse.ArgumentParser( description='Create dashboard for critical/high bugs, approved rfe and' ' blueprints. A .dash file will be created in the current' @@ -146,13 +156,12 @@ with open(file_name, 'w') as f: title = "[dashboard]\ntitle = Neutron %s Review Inbox\n" % milestone f.write(title) f.write("description = Review Inbox\n") - f.write("foreach = (project:openstack/neutron OR " - "project:openstack/neutron-lib OR " - "project:openstack/python-neutronclient OR " - "project:openstack/neutron-specs OR " - "project:openstack/neutron-fwaas OR " - "project:openstack/neutron-lbaas OR " - "project:openstack/neutron-vpnaas) status:open NOT owner:self " + f.write("foreach = (") + projects_query = [ + "project:openstack/%s" % p for p in get_stadium_projects() + ] + f.write(' OR '.join(projects_query)) + f.write(") status:open NOT owner:self " "NOT label:Workflow<=-1 " "NOT label:Code-Review>=-2,self branch:master\n") f.write("\n")