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

update_netbox_object is unstable if value ends on whitespace (like in the description) #243

Closed
monkz opened this issue Jun 23, 2020 · 3 comments · Fixed by #249
Closed
Labels
bug Something isn't working

Comments

@monkz
Copy link

monkz commented Jun 23, 2020

ISSUE TYPE
  • Bug Report
SOFTWARE VERSIONS
Ansible:

2.9.9

Netbox:

2.8.5

Collection:

0.2.3

SUMMARY

Netbox trims strings, the netbox collection detects a difference between playbook and returned value. Thous triggers an update.

    "diff": {
        "after": {
            "description": "WWN:  ",
        },
        "before": {
            "description": "WWN:",
        }
STEPS TO REPRODUCE

Create an inventory item with description that ends on whitespace.

EXPECTED RESULTS

Either the collection trims as well, or issues a warning about trailing whitespace.

ACTUAL RESULTS

It gets updated over and over, because the value with whitespace (in ansible-playbook) does not match the returned value from netbox that is trimmed.

@FragmentedPacket
Copy link
Contributor

Thanks for this report! This should be able to be fixed within the the _normalize_data method.

@monkz
Copy link
Author

monkz commented Jun 29, 2020

Works as well. thank you for this fix too

@FragmentedPacket
Copy link
Contributor

Thanks for reporting these bugs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants