From 2816f325ca9eb78b7f4044c63393d1c248a9e834 Mon Sep 17 00:00:00 2001 From: Marcus Huewe Date: Tue, 13 Sep 2016 12:39:24 +0200 Subject: [PATCH] Fix logic error in do_my A dict doesn't work here (however, this codepath shouldn't be reached at all). --- osc/commandline.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/osc/commandline.py b/osc/commandline.py index 3d2c5a28..e9a8e2e3 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -6909,18 +6909,19 @@ Please submit there instead, or use --nodevelproject to force direct submission. # if list of packages is empty user is maintainer of the whole project request_todo = {} + dummy_elm = ET.Element('dummy') roles = {} if len(what.keys()) == 2: - for i in res.get('project_id', res.get('project', {})).findall('project'): + for i in res.get('project_id', res.get('project', dummy_elm)).findall('project'): request_todo[i.get('name')] = [] roles[i.get('name')] = [p.get('role') for p in i.findall('person') if p.get('userid') == user] - for i in res.get('package_id', res.get('package', {})).findall('package'): + for i in res.get('package_id', res.get('package', dummy_elm)).findall('package'): prj = i.get('project') roles['/'.join([prj, i.get('name')])] = [p.get('role') for p in i.findall('person') if p.get('userid') == user] if not prj in request_todo or request_todo[prj] != []: request_todo.setdefault(prj, []).append(i.get('name')) else: - for i in res.get('project_id', res.get('project', {})).findall('project'): + for i in res.get('project_id', res.get('project', dummy_elm)).findall('project'): roles[i.get('name')] = [p.get('role') for p in i.findall('person') if p.get('userid') == user] if list_requests: