Fix docimpact_target project selection
I6c9a9f3f42b3a9eff33ca0522b9f23f058131433 introduced the ability to
map docimpact's to different launchpad projects but unfortunately
didn't select the correct project out of the YAML mapping.
Change-Id: If824aa429d4cf82eda474d9ff99b46d713b6af0f
diff --git a/jeepyb/projects.py b/jeepyb/projects.py
index da898b9..4cf9ffe 100644
--- a/jeepyb/projects.py
+++ b/jeepyb/projects.py
@@ -65,7 +65,8 @@
def docimpact_target(project_full_name):
- return registry.get('docimpact-group', 'unknown')
+ return registry.get_project_item(project_full_name, 'docimpact-group',
+ 'unknown')
# The following functions should be deleted when projects.yaml will be updated
diff --git a/jeepyb/utils.py b/jeepyb/utils.py
index d010e3b..f92852e 100644
--- a/jeepyb/utils.py
+++ b/jeepyb/utils.py
@@ -51,5 +51,8 @@
def __getitem__(self, item):
return self.configs[item]
- def get(self, item, default=None):
- return self.configs.get(item, default)
+ def get_project_item(self, project, item, default=None):
+ if project in self.configs:
+ return self.configs[project].get(item, default)
+ else:
+ return default