summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2022-11-15 14:35:44 +0100
committerGitHub <noreply@github.com>2022-11-15 14:35:44 +0100
commit2948248d7a05820c21b7edb57bdb8570e350b170 (patch)
treeafaec6a817a2c31d3950e7dea08a8accdfc1458c /lib
parent850c54c3b1c1cea50da912185fcd48da57cd8ac2 (diff)
downloadspack-2948248d7a05820c21b7edb57bdb8570e350b170.tar.gz
spack-2948248d7a05820c21b7edb57bdb8570e350b170.tar.bz2
spack-2948248d7a05820c21b7edb57bdb8570e350b170.tar.xz
spack-2948248d7a05820c21b7edb57bdb8570e350b170.zip
Remove exit(0) (#33896)
Since they cause --backtrace to report backtraces even with exit code 0
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/buildcache.py13
-rw-r--r--lib/spack/spack/cmd/ci.py3
2 files changed, 7 insertions, 9 deletions
diff --git a/lib/spack/spack/cmd/buildcache.py b/lib/spack/spack/cmd/buildcache.py
index d25f243039..061a34a438 100644
--- a/lib/spack/spack/cmd/buildcache.py
+++ b/lib/spack/spack/cmd/buildcache.py
@@ -454,7 +454,7 @@ def check_fn(args):
if not specs:
tty.msg("No specs provided, exiting.")
- sys.exit(0)
+ return
for spec in specs:
spec.concretize()
@@ -467,9 +467,10 @@ def check_fn(args):
if not configured_mirrors:
tty.msg("No mirrors provided, exiting.")
- sys.exit(0)
+ return
- sys.exit(bindist.check_specs_against_mirrors(configured_mirrors, specs, args.output_file))
+ if bindist.check_specs_against_mirrors(configured_mirrors, specs, args.output_file) == 1:
+ sys.exit(1)
def download_fn(args):
@@ -479,11 +480,11 @@ def download_fn(args):
least one of the required buildcache components."""
if not args.spec and not args.spec_file:
tty.msg("No specs provided, exiting.")
- sys.exit(0)
+ return
if not args.path:
tty.msg("No download path provided, exiting")
- sys.exit(0)
+ return
spec = _concrete_spec_from_args(args)
result = bindist.download_single_spec(spec, args.path)
@@ -532,8 +533,6 @@ def save_specfile_fn(args):
root_spec_as_json, args.specfile_dir, args.specs.split(), spec_format
)
- sys.exit(0)
-
def copy_buildcache_file(src_url, dest_url, local_path=None):
"""Copy from source url to destination url"""
diff --git a/lib/spack/spack/cmd/ci.py b/lib/spack/spack/cmd/ci.py
index 168455bf9c..6822772139 100644
--- a/lib/spack/spack/cmd/ci.py
+++ b/lib/spack/spack/cmd/ci.py
@@ -6,7 +6,6 @@
import json
import os
import shutil
-import sys
import llnl.util.filesystem as fs
import llnl.util.tty as tty
@@ -503,7 +502,7 @@ def ci_rebuild(args):
bindist.download_single_spec(job_spec, build_cache_dir, mirror_url=matching_mirror)
# Now we are done and successful
- sys.exit(0)
+ return 0
# Before beginning the install, if this is a "rebuild everything" pipeline, we
# only want to keep the mirror being used by the current pipeline as it's binary