From 66b6cc63a42ce5499e296a8eb478309787039749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20Gagne=CC=81?= Date: Sun, 7 Jul 2013 13:05:59 -0400 Subject: [PATCH] Implement blueprint LP mapping for projects * jeepyb/cmd/update_blueprint.py: Use the same gerrit to Launchpad project name mapping system used by update_bug.py to map blueprints to the corresponding LP projects. * Add puppet projects to the mapping. Change-Id: Ife0b76b80f80d83ecfca5d24e6caf24228e3044d Reviewed-on: https://review.openstack.org/36006 Reviewed-by: James E. Blair Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins --- jeepyb/cmd/update_blueprint.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/jeepyb/cmd/update_blueprint.py b/jeepyb/cmd/update_blueprint.py index cc9247d..cbf7649 100644 --- a/jeepyb/cmd/update_blueprint.py +++ b/jeepyb/cmd/update_blueprint.py @@ -63,8 +63,30 @@ DB_PASS = SECURE_CONFIG.get("database", "password") DB_DB = GERRIT_CONFIG.get("database", "database") +def short_project(full_project_name): + """Return the project part of the git repository name.""" + return full_project_name.split('/')[-1] + + +def git2lp(full_project_name): + """Convert Git repo name to Launchpad project.""" + project_map = { + 'stackforge/puppet-ceilometer': 'puppet-openstack', + 'stackforge/puppet-cinder': 'puppet-openstack', + 'stackforge/puppet-glance': 'puppet-openstack', + 'stackforge/puppet-horizon': 'puppet-openstack', + 'stackforge/puppet-keystone': 'puppet-openstack', + 'stackforge/puppet-nova': 'puppet-openstack', + 'stackforge/puppet-openstack_dev_env': 'puppet-openstack', + 'stackforge/puppet-quantum': 'puppet-openstack', + 'stackforge/puppet-swift': 'puppet-openstack', + 'stackforge/puppet-tempest': 'puppet-openstack', + } + return project_map.get(full_project_name, short_project(full_project_name)) + + def update_spec(launchpad, project, name, subject, link, topic=None): - group, project = project.split('/') + project = git2lp(project) spec = launchpad.projects[project].getSpecification(name=name) if not spec: return