Skip to content
This repository was archived by the owner on Mar 25, 2024. It is now read-only.

Add backwards compatibility for dashboard template variable format#93

Merged
wang-arthur merged 2 commits into
masterfrom
update_templating
May 30, 2014
Merged

Add backwards compatibility for dashboard template variable format#93
wang-arthur merged 2 commits into
masterfrom
update_templating

Conversation

@wang-arthur

Copy link
Copy Markdown
Contributor

Makes template variables in dogshell backwards compatible (the API itself was already backwards compatible)

@clofresh

Copy link
Copy Markdown
Contributor

You can avoid the code duplication by creating a function that does the parsing and passing that function into the type parameter of the add_argument calls (https://github.com/DataDog/dogapi/blob/update_templating/src/dogshell/dashboard.py#L28 and https://github.com/DataDog/dogapi/blob/update_templating/src/dogshell/dashboard.py#L37)

That way, argparse will convert the command line params into the right form.

Also, does the server api know how to handle both data types? The comma-separated one will be a list of lists, while the json one will be a list of dicts.

@wang-arthur

Copy link
Copy Markdown
Contributor Author

Thanks @clofresh! The server API handles both data types. I'll make the change you suggested and merge.

wang-arthur pushed a commit that referenced this pull request May 30, 2014
Add backwards compatibility for dashboard template variable format
@wang-arthur
wang-arthur merged commit c1fafbb into master May 30, 2014
@wang-arthur
wang-arthur deleted the update_templating branch May 30, 2014 16:21
@clofresh

Copy link
Copy Markdown
Contributor

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants