Skip to content
Snippets Groups Projects
Commit e6e1939c authored by Hans Fangohr's avatar Hans Fangohr
Browse files

Merge branch 'handle-errors-in-release-input' into 'main'

Remove trailing slash in mpsd_release input

Closes #22

See merge request !92
parents 103653cd 385d6547
No related branches found
No related tags found
1 merge request!92Remove trailing slash in mpsd_release input
Pipeline #374637 passed
......@@ -1261,6 +1261,11 @@ def main():
initialise_environment(Path(os.getcwd()))
sys.exit(0)
# sanity check for common mistakes in command line arguments
if args.release.endswith("/"): # happens easily with autocompletion
args.release = args.release.removesuffix("/")
logging.warning(f"Removed trailing slash from release: {args.release}")
# root_dir is the place where this MPSD software instance has its root
root_dir = get_root_dir()
......@@ -1275,14 +1280,6 @@ def main():
log_file,
)
# sanity check for common mistakes in command line arguments
if args.release.endswith("/"): # happens easily with autocompletion
logging.error(
f"You provided mpsd-release='{args.release}'. "
f"Did you mean '{args.release.removesuffix('/')}'?"
)
sys.exit(1)
# Check the command and run related function
if args.action == "remove":
remove_environment(args.release, root_dir, args.package_set)
......
......@@ -575,6 +575,7 @@ def test_interface(tmp_path):
# check that the help message is printed when no arguments are provided
# check that the help message is printed when -h is provided
# check that the error messages are also logged to the log file
# check that `/` in release is handled correctly
# other tests to add (ideally)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment