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 <corvus@inaugust.com> Approved: Jeremy Stanley <fungi@yuggoth.org> Reviewed-by: Jeremy Stanley <fungi@yuggoth.org> Tested-by: Jenkins
This commit is contained in:
parent
10ec3efe72
commit
66b6cc63a4
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user