forked from suse-edge/Factory
Make wait_obs correctly fail
Signed-off-by: Nicolas Belouin <nicolas.belouin@suse.com>
This commit is contained in:
parent
d97e434fce
commit
9e41ee25d9
@ -2,6 +2,7 @@ import xml.etree.ElementTree as ET
|
|||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
|
|
||||||
@ -69,15 +70,14 @@ def print_results(status: ET.Element) -> bool:
|
|||||||
print("\nPackages failing: ")
|
print("\nPackages failing: ")
|
||||||
for fail in failed:
|
for fail in failed:
|
||||||
print("\t", fail)
|
print("\t", fail)
|
||||||
return len(failed) != 0
|
return len(failed)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
project = os.environ.get("OBS_PROJECT")
|
project = os.environ.get("OBS_PROJECT")
|
||||||
sha = os.environ.get("GIT_SHA")
|
sha = os.environ.get("GIT_SHA")
|
||||||
print(f"Waiting for OBS to build {project} for commit {sha}")
|
print(f"Waiting for OBS to build {project} for commit {sha}")
|
||||||
status = do_wait(project, sha)
|
status = do_wait(project, sha)
|
||||||
if print_results(status):
|
sys.exit(print_results(status))
|
||||||
return 1
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
Loading…
x
Reference in New Issue
Block a user