From 7d54b5c6857eefcfd74da19a5d3e7ba879380451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 18 Apr 2017 09:39:59 +0200 Subject: [PATCH] Fixing request handling for OBS < 2.8 request creator is only delivered by OBS 2.8 and newer. Makeing this not a hard condition therefor. (introduced in d68507fa95703443922d1b9dab82b0da206aa692) Also fixes test suite failure --- osc/core.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osc/core.py b/osc/core.py index 8d8c7b49..166edf13 100644 --- a/osc/core.py +++ b/osc/core.py @@ -2697,10 +2697,12 @@ class Request: def read(self, root): """read in a request""" self._init_attributes() - if not root.get('id') or not root.get('creator'): + if not root.get('id'): raise oscerr.APIError('invalid request: %s\n' % ET.tostring(root, encoding=ET_ENCODING)) self.reqid = root.get('id') - self.creator = root.get('creator') + if root.get('creator'): + # OBS 2.8 and later is delivering creator informations + self.creator = root.get('creator') if root.find('state') is None: raise oscerr.APIError('invalid request (state expected): %s\n' % ET.tostring(root, encoding=ET_ENCODING)) self.state = RequestState(root.find('state'))