Make sure the hash is only updated when osc succeeds
This commit is contained in:
parent
278764a1cc
commit
3e8c404fdf
1 changed files with 6 additions and 4 deletions
|
@ -80,8 +80,10 @@ def run_osc(repository, package_name):
|
|||
if pid.returncode != 0:
|
||||
logging.error("Error during service run, package {}".format(
|
||||
package_name))
|
||||
return False
|
||||
|
||||
logging.debug("Package {} complete".format(package_name))
|
||||
return True
|
||||
|
||||
|
||||
def update_package(hash_data, package_name, remote_name, obs_repository,
|
||||
|
@ -104,10 +106,10 @@ def update_package(hash_data, package_name, remote_name, obs_repository,
|
|||
|
||||
if remote_hash != current_hash:
|
||||
logging.debug("Hash doesn't match, updating")
|
||||
run_osc(obs_repository, package_name)
|
||||
hash_data[obs_repository][remote_name] = remote_hash
|
||||
hash_data.save()
|
||||
hash_data.to_json()
|
||||
if run_osc(obs_repository, package_name):
|
||||
hash_data[obs_repository][remote_name] = remote_hash
|
||||
hash_data.save()
|
||||
hash_data.to_json()
|
||||
|
||||
|
||||
def update_packages(cache_file, repo_mapping_file):
|
||||
|
|
Loading…
Add table
Reference in a new issue