nexus.release_staging_repo has an error condition if the staging repo
is not released when checked, as a non-existent "stopped" field will
return a NoneType, causing an error when .text is read. We avoid this
by checking for the existence of the "stopped" field before attempting
to read the text.
Issue: RELENG-3813
Change-Id: I0fae854a3ee52118806f70ea8b6faacc5fda430b
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
events = root.findall("./stagingActivity")
for event in events:
name = event.find("name")
- if name.text == "release":
- stopped = event.find("stopped")
+ stopped = event.find("stopped")
+ if name.text == "release" and stopped is not None:
log.info("Repo released at: {}".format(stopped.text))
released = True
if not released:
--- /dev/null
+---
+fixes:
+ - |
+ Add check for "stopped" event property before reading property text in
+ nexus.release_staging_repo, in order to avoid possible missing attribute
+ error.