From 42e692a9ff1fed94cbb1ba9335d775a5e1615c39 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 4 Apr 2016 08:39:32 -0400 Subject: [PATCH] ceph-rest-api: do not include single-option CephChoices in prefix This breaks commands like COMMAND("fs flag set name=flag_name,type=CephChoices,strings=enable_multiple " "name=val,type=CephString", \ "Set a global CephFS flag", \ "fs", "rw", "cli,rest") with only one option: PUT fs/flag/set?flag_name=enable_multiple&val=true: 400 FAILURE: url http://localhost:5000/api/v0.1/fs/flag/set?flag_name=enable_multiple&val=true expected 200, got 400 Response content:
Possible commands:MethodDescription
fs/flag/set?flag_name=enable_multiple&va l=val(<string>) PUTSet a global CephFS flag
...and I can't tell why it's there. Signed-off-by: Sage Weil --- src/pybind/ceph_rest_api.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/pybind/ceph_rest_api.py b/src/pybind/ceph_rest_api.py index 7792013a205..2dfe6b6140c 100755 --- a/src/pybind/ceph_rest_api.py +++ b/src/pybind/ceph_rest_api.py @@ -224,15 +224,6 @@ def generate_url_and_params(app, sig, flavor): # prefixes go in the URL path if desc.t == CephPrefix: url += '/' + desc.instance.prefix - # CephChoices with 1 required string (not --) do too, unless - # we've already started collecting params, in which case they - # too are params - elif (desc.t == CephChoices and - len(desc.instance.strings) == 1 and - desc.req and - not str(desc.instance).startswith('--') and - not params): - url += '/' + str(desc.instance) else: # tell/ is a weird case; the URL includes what # would everywhere else be a parameter