-
Notifications
You must be signed in to change notification settings - Fork 73
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
group_by number strip the first number and query problem #119
Comments
The problem you are describing here looks like a group name sanitization issue. Non-deprecated parts of the ServiceNow inventory plugin respects the TRANSFORM_INVALID_GROUP_CHARS configuration option. But older parts (things like Now, I have some bad news. The replacement functionality does not know how to handle data with dots in the name. The old functionality does know how to work with such data by sheer luck. We never anticipated that plugins and modules will need to handle "nested" data. This will need some work to implement properly and make it accessible to Ansible. As an ugly ugly workaround, you can locally edit your copy of the inventory plugin and replace the servicenow.itsm/plugins/inventory/now.py Line 500 in 4eb424f
group_name = orig_safe(record[category]) We cannot do this change in the plugin itself because it would break backward compatibility, but for local installations, this should be safe. To properly resolve the issue, we will need to fix #100. Once a fix for that issue is in place, you will be able to migrate to non-deprecated functionality. |
Hi @tadeboro First, Big Thx for you time. Do you think it would be possible to respect the variable in ansible.cfg?
or
As for nested variable, I think it still works except when I use I'm going to experiment using a custom version of A huge thank you for that. Regarding the fact that the Thanks in advance! |
After following your advice to use a fork version of your code to apply a workaround. I also took the opportunity to add some print to finally find how to display the query sent to ServiceNow when building the inventory via
I add that.
What I see on my terminal is that the
Can you confirm that you have the same result as me please. |
@tadeboro Can you please help me with this problem. |
@tadeboro ^^ |
@metabsd Is this issue still present? Thanks in advance. |
@metabsd I can't reproduce it in |
Closing due to inactivity. Please feel free to re-open the issue. Thanks. |
SUMMARY
When using the group_by with a Servicenow field that contains a number. The first digit is replaced by _
ISSUE TYPE
COMPONENT NAME
servicenow.itsm.now
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Ubuntu 20.04 running the inventory script on ServiceNOW Quebec version
STEPS TO REPRODUCE
EXPECTED RESULTS
_
ACTUAL RESULTS
Normally I expecte to see 5 digit. Like the first one in ServiceNOW is
21004
ans not_1004
Thx in advance!!!
The text was updated successfully, but these errors were encountered: