From 843b7936095b149b1f01c30e418c9083f5ad7bd3 Mon Sep 17 00:00:00 2001 From: Pallab Pain Date: Fri, 23 Aug 2024 16:05:55 +0530 Subject: [PATCH] fix(configtree): returns error when no files are provided in import 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/ --- riocli/configtree/import_keys.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/riocli/configtree/import_keys.py b/riocli/configtree/import_keys.py index 97c12dd3..56a3fee4 100644 --- a/riocli/configtree/import_keys.py +++ b/riocli/configtree/import_keys.py @@ -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: