summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Bartosh <eduard.bartosh@intel.com>2013-08-19 19:01:25 +0300
committerEduard Bartosh <eduard.bartosh@intel.com>2013-08-19 09:18:27 -0700
commitc3bf525c9af00c9d7154d761ca391d3a9c709a1e (patch)
tree1d7f17d2583a4c770809b7217cc5074afec2a5da
parent774909df20860c4ed99e6f21a04c9c2aa8707b21 (diff)
downloadrepa-c3bf525c9af00c9d7154d761ca391d3a9c709a1e.tar.gz
repa-c3bf525c9af00c9d7154d761ca391d3a9c709a1e.tar.bz2
repa-c3bf525c9af00c9d7154d761ca391d3a9c709a1e.zip
Added target project to the group project name
For other pieces of the workflow and for the sake of consistency it's better to have the same naming scheme for projects and groups. Change-Id: I86621486220c10b2c021e639508a09e8ab953401 Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com> Reviewed-on: https://otctools.jf.intel.com/review/5994 Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
-rw-r--r--repa/common.py11
-rwxr-xr-xrepa/group.py2
-rwxr-xr-x[-rw-r--r--]setup.py0
3 files changed, 4 insertions, 9 deletions
diff --git a/repa/common.py b/repa/common.py
index 9384839..ff84a7f 100644
--- a/repa/common.py
+++ b/repa/common.py
@@ -21,13 +21,8 @@ class RepaException(Exception):
def get_project_by_name(obs, name):
"""Lookup for a project in OBS by submission or group name."""
- if name.startswith("submitgroup"):
- mask = '^%s%s$'
- else:
- mask = '^%s.*:%s$'
-
- projects = list(obs.get_projects(mask % (OBS_PREFIX,
- name.replace('/', ':'))))
+ projects = list(obs.get_projects('^%s.*:%s$' % (OBS_PREFIX,
+ name.replace('/', ':'))))
if not projects:
raise RepaException('OBS project not found for %s' % name)
if len(projects) > 1:
@@ -36,7 +31,6 @@ def get_project_by_name(obs, name):
return projects[0][0], json.loads(projects[0][1])
-
def _resolve_submissions(obs, name):
"""Get list of submissions with meta. Resolves submitgroups."""
project, meta = get_project_by_name(obs, name)
@@ -71,6 +65,7 @@ def accept_or_reject(obs, submission, state, comment=''):
# and immediately set its state
obs.set_sr_state(reqid, state=state, message=message, force=True)
print 'set SR state to', state
+
# delete submit group
if submission.startswith('submitgroup'):
delete_project(obs, submission)
diff --git a/repa/group.py b/repa/group.py
index 95b71e8..83a017a 100755
--- a/repa/group.py
+++ b/repa/group.py
@@ -74,7 +74,7 @@ def create_group_project(obs, submissions, meta, comment):
timestamp)
gmeta = {'name': name, 'obs_target_prj': target_prj,
'submissions': submissions, 'comment': comment}
- project = '%s%s' % (OBS_PREFIX, name.replace('/', ':'))
+ project = '%s%s:%s' % (OBS_PREFIX, str(target_prj), name.replace('/', ':'))
saved = sys.stdout
sys.stdout = StringIO()
diff --git a/setup.py b/setup.py
index 47f7dee..47f7dee 100644..100755
--- a/setup.py
+++ b/setup.py