1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-12 16:56:15 +01:00

- do not move back service generated files when service failed

This commit is contained in:
Adrian Schröter 2012-02-04 10:41:54 +01:00
parent 3ed94d9694
commit 39233d3b93

View File

@ -349,6 +349,15 @@ class Serviceinfo:
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.
for filename in os.listdir(temp_dir):
os.unlink(os.path.join(temp_dir, filename)
os.rmdir(temp_dir)
return 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):
shutil.move( os.path.join(temp_dir, filename), os.path.join(dir, filename) )
@ -357,12 +366,6 @@ class Serviceinfo:
shutil.move( os.path.join(temp_dir, filename), os.path.join(dir, "_service:"+name+":"+filename) )
os.rmdir(temp_dir)
if r != 0:
print "Aborting: service call failed: " + c
# FIXME: addDownloadUrlService calls si.execute after
# updating _services.
return r
return 0
class Linkinfo: