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

Avoid a potential http request if there are no services

The vc_export_env call was introduced in commit
37ca5535ce ("Export vc env vars when
running a source service") and broke the testsuite. The potential
http request is useless if there are no services. Hence, avoid it.

Thanks to Marco Strigl for catching the testsuite error!
This commit is contained in:
Marcus Huewe 2019-02-04 12:16:54 +01:00
parent 37ca5535ce
commit 555efc845f

View File

@ -406,6 +406,12 @@ class Serviceinfo:
data = { 'name' : singleservice, 'command' : [ singleservice ], 'mode' : '' }
allservices = [data]
if not allservices:
# short-circuit to avoid a potential http request in vc_export_env
# (if there are no services to execute this http request is
# useless)
return 0
# services can detect that they run via osc this way
os.putenv("OSC_VERSION", get_osc_version())