From 3aa3ea51907a1433d5226c45ff231b3204853071 Mon Sep 17 00:00:00 2001 From: Pallab Pain Date: Sun, 21 Jan 2024 21:23:08 +0530 Subject: [PATCH] fix(parameter): prints message when there is nothing to upload When the user run rio parameter upload and there's no tree found to upload, the command will not print an appropriate message informing the user that there'sn nothing to upload. Wrike Tickets: 1. https://www.wrike.com/open.htm?id=1182851006 2. https://www.wrike.com/open.htm?id=1182849811 --- riocli/parameter/upload.py | 4 ++++ riocli/parameter/utils.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/riocli/parameter/upload.py b/riocli/parameter/upload.py index 7231a3d1..f92cc656 100644 --- a/riocli/parameter/upload.py +++ b/riocli/parameter/upload.py @@ -56,6 +56,10 @@ def upload_configurations( click.secho('{} {}'.format(Symbols.ERROR, e), fg=Colors.RED) raise SystemExit(1) + if not trees: + click.secho('{} No configuration trees to upload.'.format(Symbols.INFO), fg=Colors.BRIGHT_CYAN) + return + click.secho('Following configuration trees will be uploaded') click.secho() display_trees(path, trees) diff --git a/riocli/parameter/utils.py b/riocli/parameter/utils.py index a706eb7b..462a833e 100644 --- a/riocli/parameter/utils.py +++ b/riocli/parameter/utils.py @@ -48,7 +48,7 @@ def filter_trees( trees.append(each) if tree_names and not trees: - raise Exception('specified tree names are invalid') + raise Exception('one or more specified tree names are invalid') return trees