Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mgr/dashboard: fix query parameters in task annotated endpoints #23229

Merged
merged 1 commit into from Jul 30, 2018

Conversation

rjfd
Copy link
Contributor

@rjfd rjfd commented Jul 25, 2018

Fixes: http://tracker.ceph.com/issues/25096

I've also added a unit test to capture the issue reported above.

Signed-off-by: Ricardo Dias rdias@suse.com

if idx < len(args):
arg_map[arg] = args[idx]
arg_map[param['name']] = args[idx]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many ]s and [s. Can we create a new named tuple FuncParam in _get_function_params?

from collections import namedtuple
FuncParam = namedtuple('FuncParam', 'name default required')
func_params.append(FuncParam(name=param , default=val, required=False)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could but that would require a lot of changes which are out of scope of this fix. I suggest you to create an issue for that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wouldn't require any algorithmic changes, except for replacing param['xyz'] with param.xyz

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _get_function_params function is used in more 6 places throughout the code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. That's why we need to return proper types here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code in this PR is fixing a concrete bug reported in the issue tracker. I don't see a strong reason to also add an additional commit with code cleanup to this PR. The code cleanup can be done in a separate PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, this issue is just an inconvenience to @tspmelo . Merging this as it is would introduce further technical dept.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Btw, I'm not blocking this PR in github)

Copy link
Contributor

@tspmelo tspmelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Endpoint where I found this problem is working now.

@sebastian-philipp
Copy link
Contributor

The fix itself works as expected.

@tchaikov tchaikov merged commit 53951a8 into ceph:master Jul 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants