1
0
Fork 0

Get rid of the osc based trigger mechanism and use the API

This commit is contained in:
Luca Beltrame 2021-01-04 23:03:01 +01:00
parent f341791bcf
commit 843fabc368
Signed by: einar
GPG key ID: 4707F46E9EC72DEC

View file

@ -86,7 +86,7 @@ def trigger_update(repository, package_name, token):
result = requests.post(OBS_URL, params=parameters, headers=header)
if not result:
logging.error("Error during service run, package %s, error code %s, url %s",
logging.error("Error during service run, package %s, error code %s",
package_name, result.status_code, result.url)
return False
@ -94,24 +94,6 @@ def trigger_update(repository, package_name, token):
return result
def run_osc(repository, package_name):
cmd = "osc service remoterun {0} {1}"
cmd = cmd.format(repository, package_name)
logging.debug("Running %s", cmd)
logging.info("Updating package %s", package_name)
pid = sarge.run(cmd)
if pid.returncode != 0:
logging.error("Error during service run, package %s", package_name)
return False
logging.debug("Package %s complete", package_name)
return True
def update_package(hash_data, package_name,
remote_name, obs_repository,
branch, token):