-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
Facts with int values which are strings internally are not findable #706
Comments
Hi @ryaner! Thanks for reporting this. I don’t know when I will have the time to dig into this as I will be pretty busy over the next ~2 weeks so even more than always, PR with a fix is very welcome. |
My current patch is below, but I keep thinking there must be a better solution that this. So far it does work on all the
|
If it works and there are no side effects, then let’s create a PR and merge it. Let’s be pragmatic, @ryaner. :) |
Force quote strings for the facts page - #706
The fix has been released in v4.0.3 today. |
Nice thanks for that @gdubicki |
Describe the bug
Currently puppetboard is able to detect the facts value type correctly from the puppetdb calls, but the generated links do not differentiate between string and int, resulting in the call to
parse_python
switching it back to an int.An example will hopefully make this clearer
Using Centos operating system facts, which are stored into puppetdb as strings.
https://puppetdb/fact/operatingsystemmajrelease
This page will list all the hosts with this fact present. The generated html is showing type string here too
Following the link - https://puppetdb/fact/operatingsystemmajrelease/6 - will display no entries.
The facts code is calling
parse_python
which is returning theint
type to the query.puppetboard/puppetboard/views/facts.py
Lines 62 to 65 in c0db5ab
If I manually quote the value - https://puppetdb/fact/operatingsystemmajrelease/"6" - the search works and displays results.
Values which are
int
internally, and displayed asint
on the facts page do search correctly.Puppetboard version
F.e. 3.6.1 (verified code has not changed for this flow since)
Environment and installation method
F.e.:
While quoting all strings does work as a solution here, that just feels wrong which is why I haven't attached a PR here. If you have a better solution that could work, I'm happy to PR things.
Pretty print explicitly tries to not quote things too
puppetboard/puppetboard/static/js/pretty.js
Lines 5 to 6 in c0db5ab
The text was updated successfully, but these errors were encountered: