summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Styk <mastyk@redhat.com>2019-05-15 14:06:09 +0200
committerMartin Styk <mastyk@redhat.com>2019-05-15 12:55:07 +0000
commit4f269a8f2a4d3f08b3eac13285a654e1cb0ce4c3 (patch)
tree111d6296f76e88fabda66350f869cdabe33b191a
parent25ca6b220a48e229d3436fef2c5db32006c92231 (diff)
Fix crash for bkr job-submit with --combine
Bug: 1455424 Change-Id: Ied1c6ee3210642ccdbd829022d3a64b9cef0a39f Signed-off-by: Martin Styk <mastyk@redhat.com>
-rw-r--r--Client/src/bkr/client/commands/cmd_job_submit.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Client/src/bkr/client/commands/cmd_job_submit.py b/Client/src/bkr/client/commands/cmd_job_submit.py
index 100a5aa..5a9e598 100644
--- a/Client/src/bkr/client/commands/cmd_job_submit.py
+++ b/Client/src/bkr/client/commands/cmd_job_submit.py
@@ -126,7 +126,9 @@ combineTag = combine_tag
def combine_attr(olddoc, newdoc, attr_name):
# Take the attr from the first olddoc and set it to the newdoc.
- if attr_name not in newdoc._attrs and attr_name in olddoc._attrs:
+ # py3 _attrs are None instead of {}
+ if (newdoc._attrs is None or attr_name not in newdoc._attrs
+ and (olddoc._attrs and attr_name in olddoc._attrs)):
newdoc.setAttribute(attr_name, olddoc.getAttribute(attr_name))