From c5a6226f06c2aa44d1921045426feffdd03b539b Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Sat, 27 Jul 2024 18:41:14 +0200 Subject: [PATCH] script/backport-create-issue: handle ResourceAttrError when getting CF_TAGS Older versions of python-redmine may raise ResourceAttrError here instead of returning None, see [1]. Being prepared for an exception seems like a good idea regardless given how this field recently got recreated. [1] https://github.com/maxtepkeev/python-redmine/commit/0de5689ef5891c1be263c0b3deb8b03966a9c5bd Signed-off-by: Ilya Dryomov --- src/script/backport-create-issue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/script/backport-create-issue b/src/script/backport-create-issue index 4621411a101b0..10ed843e2b361 100755 --- a/src/script/backport-create-issue +++ b/src/script/backport-create-issue @@ -319,11 +319,13 @@ def mark_as_processed(r, issue): logging.debug("custom_fields: %s", list(issue['custom_fields'])) tags_cf = next(filter(lambda x: x['id'] == CF_TAGS, issue['custom_fields']), None) - if tags_cf is None: tags = '' else: - tags = tags_cf.value + try: + tags = tags_cf.value + except ResourceAttrError: + tags = None if tags is None: tags = '' else: -- 2.39.5