From b55c702822317a37ceb8c4fe9e5761336174d805 Mon Sep 17 00:00:00 2001 From: Ricardo Dias Date: Fri, 11 Jan 2019 16:45:20 +0000 Subject: [PATCH] mgr/dashboard: controllers: improve task metadata parameter binding Signed-off-by: Ricardo Dias --- src/pybind/mgr/dashboard/controllers/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/dashboard/controllers/__init__.py b/src/pybind/mgr/dashboard/controllers/__init__.py index a0fa08e2b47..2c46c9bf3b0 100644 --- a/src/pybind/mgr/dashboard/controllers/__init__.py +++ b/src/pybind/mgr/dashboard/controllers/__init__.py @@ -321,7 +321,13 @@ class Task(object): pos = int(param) md[k] = arg_map[pos] except ValueError: - md[k] = arg_map[v[1:-1]] + if param.find('.') == -1: + md[k] = arg_map[param] + else: + path = param.split('.') + md[k] = arg_map[path[0]] + for i in range(1, len(path)): + md[k] = md[k][path[i]] else: md[k] = v task = TaskManager.run(self.name, md, func, args, kwargs, -- 2.39.5