Skip to content

Commit

Permalink
fix(configtree): returns error when no files are provided in import
Browse files Browse the repository at this point in the history
The files argument in the import command is variadic. If you forget
specifying a tree name and pass only file to import, it will assume the
file as the tree name and the files tuple will be empty. It has to be
handled explicitly per the documentation here:
https://click.palletsprojects.com/en/8.1.x/arguments/
  • Loading branch information
pallabpain committed Sep 4, 2024
1 parent 07c615a commit 843b793
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions riocli/configtree/import_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ def import_keys(
Note: If --etcd-endpoint is provided, the keys are imported to the local etcd cluster instead of the rapyuta.io cloud.
"""
if not files:
spinner.text = click.style('No files provided.', fg=Colors.RED)
spinner.red.fail(Symbols.ERROR)
raise SystemExit(1)

data, metadata = _process_files_with_overrides(files, overrides, spinner)

if export_directory is not None:
Expand Down

0 comments on commit 843b793

Please sign in to comment.