Skip to content

Commit

Permalink
CLI: Change Critical to Report if family exists in install command
Browse files Browse the repository at this point in the history
The `aiida-pseudo install` command was printing a `CRITICAL` log message
if the requested family already exists. Since the desired goal is
achieved and so in reality the command didn't really fail, it makes more
sense to use a `REPORT` message instead. The command still returns a
non-zero exit code such that scripts can determine whether a new family
was actually installed or not.
  • Loading branch information
sphuber authored May 8, 2023
1 parent c04a7a7 commit 3887762
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/aiida_pseudo/cli/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
import pathlib
import shutil
import sys
import tempfile
import typing as t

Expand Down Expand Up @@ -210,7 +211,8 @@ def cmd_install_sssp(version, functional, protocol, download_only, traceback):
echo.echo_critical(f'{configuration} is not a valid configuration.')

if not download_only and QueryBuilder().append(SsspFamily, filters={'label': label}).first():
echo.echo_critical(f'{SsspFamily.__name__}<{label}> is already installed')
echo.echo_report(f'{SsspFamily.__name__}<{label}> is already installed')
sys.exit(1)

with tempfile.TemporaryDirectory() as dirpath:

Expand Down Expand Up @@ -315,7 +317,8 @@ def cmd_install_pseudo_dojo(
echo.echo_critical(f'{configuration} is not a valid configuration')

if not download_only and QueryBuilder().append(PseudoDojoFamily, filters={'label': label}).first():
echo.echo_critical(f'{PseudoDojoFamily.__name__}<{label}> is already installed.')
echo.echo_report(f'{PseudoDojoFamily.__name__}<{label}> is already installed.')
sys.exit(1)

with tempfile.TemporaryDirectory() as dirpath:

Expand Down

0 comments on commit 3887762

Please sign in to comment.