From bf498b829c63a89ad42e6352fd80a3f3165d2acf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 27 Mar 2018 15:35:38 +0200 Subject: [PATCH] @manager.command and @manager.option are sometimes mutually exclusive @manager.option also registers the function as command, so the double use is generally unnecessary. Furthermore, @manager.command will register CLI options based on the function parameters, which potentially conflict with the ones registered with the following @manager.options decorators. Note that positional arguments should be given in reverse order. --- pillar/cli/operations.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pillar/cli/operations.py b/pillar/cli/operations.py index 67a4e632..0d0216e0 100644 --- a/pillar/cli/operations.py +++ b/pillar/cli/operations.py @@ -64,9 +64,8 @@ def mass_copy_between_backends(src_backend='cdnsun', dest_backend='gcs'): log.info('%i files we did not copy', copy_errs) -@manager_operations.command -@manager_operations.option('-p', '--project', dest='dest_proj_url', - help='Destination project URL') +@manager_operations.option('dest_proj_url', help='Destination project URL') +@manager_operations.option('node_uuid', help='ID of the node to move') @manager_operations.option('-f', '--force', dest='force', action='store_true', default=False, help='Move even when already at the given project.') @manager_operations.option('-s', '--skip-gcs', dest='skip_gcs', action='store_true', default=False,