1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-24 03:02:12 +01:00

- fix error handling when a service breaks

This commit is contained in:
Adrian Schröter 2011-12-12 10:04:21 +01:00
parent 46555269e6
commit 0d1e9d22f7

View File

@ -348,11 +348,6 @@ class Serviceinfo:
if conf.config['verbose'] > 1 or verbose:
print "Run source service:", c
r = subprocess.call(c, shell=True)
if r != 0:
print "Aborting: service call failed: " + c
# FIXME: addDownloadUrlService calls si.execute after
# updating _services.
ret = r
if service['mode'] == "disabled" or service['mode'] == "trylocal" or service['mode'] == "localonly" or callmode == "local" or callmode == "trylocal":
for filename in os.listdir(temp_dir):
@ -362,7 +357,13 @@ class Serviceinfo:
shutil.move( os.path.join(temp_dir, filename), os.path.join(dir, "_service:"+name+":"+filename) )
os.rmdir(temp_dir)
return ret
if r != 0:
print "Aborting: service call failed: " + c
# FIXME: addDownloadUrlService calls si.execute after
# updating _services.
return r
return 0
class Linkinfo:
"""linkinfo metadata (which is part of the xml representing a directory