From 2b9844dbb2f855c5007ece63ac3817885d6e8fab Mon Sep 17 00:00:00 2001 From: Christophe Courtaut Date: Tue, 15 Oct 2013 12:09:06 +0200 Subject: [PATCH] Fix option parsing for destination arg As mentionned at http://docs.python.org/3.4/library/argparse.html#nargs, nargs=1 will not provide the default behaviour, but instead will produce a list of args, and that is not what we want. This patch uses nargs=None to provide default behaviour instead. As it is a positionnal argument, we can't use required option. Signed-off-by: Christophe Courtaut --- radosgw_agent/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radosgw_agent/cli.py b/radosgw_agent/cli.py index bf3ed79..c1c1f64 100644 --- a/radosgw_agent/cli.py +++ b/radosgw_agent/cli.py @@ -81,7 +81,7 @@ def parse_args(): parser.add_argument( 'destination', type=check_endpoint, - nargs=1 if 'destination' not in defaults else '?', + nargs=None if 'destination' not in defaults else '?', help='radosgw endpoint to which to sync ' '(e.g. http://zone2.example.org:8080)', ) -- 2.47.3