From e9cc00098738462e0bdc7327231c7473b162739e Mon Sep 17 00:00:00 2001 From: Marcus Huewe Date: Tue, 13 Sep 2016 12:34:48 +0200 Subject: [PATCH] Fix non-existent user handling in do_my/get_user_projpkgs_request_list This fixes the issue reported in PR #227. --- osc/commandline.py | 6 +++--- osc/core.py | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/osc/commandline.py b/osc/commandline.py index 52a0c33d..3d2c5a28 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -6897,9 +6897,9 @@ Please submit there instead, or use --nodevelproject to force direct submission. print("") return except HTTPError as e: - if e.code == 400: - # skip it ... try again with old style below - pass + if e.code != 400: + raise e + # skip it ... try again with old style below res = get_user_projpkgs(apiurl, user, role_filter, exclude_projects, 'project' in what, 'package' in what, diff --git a/osc/core.py b/osc/core.py index c6fd308a..8291a181 100644 --- a/osc/core.py +++ b/osc/core.py @@ -4321,6 +4321,8 @@ def get_user_projpkgs_request_list(apiurl, user, req_state=('new', 'review', ), for i in res['package_id'].findall('package'): if not i.get('project') in projects: projpkgs.setdefault(i.get('project'), []).append(i.get('name')) + if not projpkgs: + return [] xpath = '' for prj, pacs in projpkgs.items(): if not len(pacs):