-
Notifications
You must be signed in to change notification settings - Fork 32
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
fixes #67 #86
fixes #67 #86
Conversation
24a58c2
to
995cda7
Compare
I want to say something like |
I don't like using the term facts, since it would indicate the intention is to modify facts, when it is the root keys, I know there is a better term, but can't see it yet. |
I like the idea, but I wonder if Boolean will be sufficient? |
I believe What you described is the default? |
OK, I see: |
plugins/action/query_graphql.py
Outdated
# the data structure, e.g. hostvars[inventory_hostname] | ||
if args.get("populate_root"): | ||
results["ansible_facts"] = nautobot_response.json.get("data") | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need the else here as we should be returning the data regardless. The flag should just set the facts or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had that at first, it seemed like duplicate, what say everyone else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go ahead and remove the else, remove the indent for the results. Then the data key will be populated regardless, whether it has data or it is None
.
I would suggest: I like the second one, intuitive and shorter. |
plugins/modules/query_graphql.py
Outdated
- name: Obtain list of devices at site in variables from Nautobot | ||
networktocode.nautobot.query_graphql: | ||
url: http://nautobot.local | ||
token: thisIsMyToken | ||
query: "{{ query_string }}" | ||
variables: "{{ variables }}" | ||
populate_root: "yes" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't that be boolean true
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In ansible they are equivalent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I know, unquoted yes
is also evaluated as bool True
.
This is more about documentation consistency, it's described as type bool in DOCUMENTATION
section.
I was looking form a static-typing perspective, where bool is True
or False
without making assumptions about ansible internals, maybe unnecessarily. Anyway I don't have any issue with it, just a friendly suggestion.
@FragmentedPacket can you take a look. |
1fb3ba7
to
6553a0c
Compare
Co-authored-by: Josh VanDeraa <jv@networktocode.com>
c2da247
Removes display from bandit.
I am not sure
populate_root
is the best name, so welcome to hear suggestions. I updated the testing for similar tests.