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

contrib/inventory/nsot.py: Make it compatible with NSoT v1.x #19421

Merged
merged 1 commit into from
Feb 10, 2017
Merged

contrib/inventory/nsot.py: Make it compatible with NSoT v1.x #19421

merged 1 commit into from
Feb 10, 2017

Conversation

allanice001
Copy link
Contributor

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

contrib/inventory/nsot

ANSIBLE VERSION
2.2.0.0
SUMMARY

To make this compatible with NSoT v1.x, removing ['data']['devices'].


To make this compatible with NSoT v1.x, removing ['data']['devices'].
@ansibot ansibot added affects_2.3 This issue/PR affects Ansible v2.3 bugfix_pull_request labels Dec 16, 2016
@gundalow gundalow changed the title Update nsot.py contrib/inventory/nsot.py: Make it compatible with NSoT v1.x Dec 19, 2016
@gundalow
Copy link
Contributor

@coxley I believe you created the original inventory script. Could you please review this change. Thanks

@gundalow gundalow added the networking Network category label Dec 19, 2016
@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Dec 19, 2016
Copy link
Contributor

@gundalow gundalow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed in #ansible-meeting on 2016-12-20

  • This change breaks anyone using NSoT < 1.0 which was released 1.0 (2016-04-27)
  • Can you please make this compatible with old and newer nsot data

Thanks

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Dec 20, 2016
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Jan 2, 2017
@coxley
Copy link
Contributor

coxley commented Jan 3, 2017

Changes look appropriate for the new API version to me! Simple enough change really.

@allanice001, if you could just show output testing the functionality from a --list or something that'd be cool. :)

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Jan 4, 2017
@gundalow
Copy link
Contributor

@allanice001 Could you please show the --list output (or similar) as requested above.

@allanice001
Copy link
Contributor Author

allanice001 commented Jan 25, 2017

$ NSOT_INVENTORY_CONFIG=$PWD/test.yaml nsot.py --list | jq '.'
{
"routers": {
"hosts": [
"test1.example.com"
],
"vars": {
"cool_level": "very",
"group": "routers"
}
},
"firewalls": {
"hosts": [
"test2.example.com"
],
"vars": {
"cool_level": "enough",
"group": "firewalls"
}
},
"_meta": {
"hostvars": {
"test2.example.com": {
"make": "SRX",
"site_id": 1,
"id": 108
},
"test1.example.com": {
"make": "MX80",
"site_id": 1,
"id": 107
}
}
},
"rtr_and_fw": {
"hosts": [
"test1.example.com",
"test2.example.com"
],
"vars": {}
}
}
$ NSOT_INVENTORY_CONFIG=$PWD/test.yaml nsot.py --host test1 | jq '.'
{
"make": "MX80",
"site_id": 1,
"id": 107
}

@gundalow
Copy link
Contributor

@coxley The details you've asked for have been added. If you are happy I'll get this merged.

@coxley
Copy link
Contributor

coxley commented Feb 10, 2017

Sorry, have been out of town. LGTM!!

@gundalow gundalow merged commit e246bd1 into ansible:devel Feb 10, 2017
@gundalow
Copy link
Contributor

Thanks everyone, merged.

Just as a heads up, we have a Network Working Group that you may be interested in https://github.com/ansible/community/blob/master/MEETINGS.md

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bugfix_pull_request labels Mar 5, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.3 This issue/PR affects Ansible v2.3 bug This issue/PR relates to a bug. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. networking Network category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants