meraki_static_route - Remove unnecessary API call (#55528)

* Make module not get all nets every time it's executed with net_id

* Add changelog fragment

* Update changelogs/fragments/meraki_static_route_api_calls.yml

Co-Authored-By: kbreit <kevin.breit@kevinbreit.net>
This commit is contained in:
Kevin Breit 2019-04-24 11:16:51 -05:00 committed by Nathaniel Case
parent 6e9379fe11
commit 7b7d6a1fef
2 changed files with 4 additions and 1 deletions

View file

@ -0,0 +1,3 @@
---
bugfixes:
- "meraki_static_route - Module would make unnecessary API calls to Meraki when ``net_id`` is specified in task."

View file

@ -328,9 +328,9 @@ def main():
org_id = meraki.params['org_id']
if not org_id:
org_id = meraki.get_org_id(meraki.params['org_name'])
nets = meraki.get_nets(org_id=org_id)
net_id = meraki.params['net_id']
if net_id is None:
nets = meraki.get_nets(org_id=org_id)
net_id = meraki.get_net_id(net_name=meraki.params['net_name'], data=nets)
if meraki.params['state'] == 'query':