Cleanup job now takes project name either from 'project' or 'sourceproject'
field of the event structure, passed from OBS.
Previously it was taking project name only from 'project' field, which is set
for OBS_REPO_PUBLISHED event and is not set for SR_ACCEPTED event.
This was the reason for not removing prerelease projects when SR is accepted.
Fixes: #1649
Change-Id: Ie9d37f0dbba7e9d92a436e755ec0a32d636f7d3c
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
content = trigger_info(os.getenv("TRIGGER_INFO"))
- project = content.get("project")
+ project = content.get("project") or content.get("sourceproject")
+
build = BuildService(obs_api, obs_user, obs_passwd)
# Init backend database