Meraki performance fixes for net and org lookups (#51395)

* Performance fixes for net and org lookups
- Both methods had duplicate lookups
- This should significantly improve performance
- Currently untested

* Add ChangeLog file

* Change from bugfix to bugfixes and change indent
pull/52550/head
Kevin Breit 6 years ago committed by Dag Wieers
parent 75ed19a561
commit c254b93796

@ -0,0 +1,2 @@
bugfixes:
- Meraki - Lookups using org_name or net_name no longer query Meraki twice, only once. Major performance improvements.

@ -157,7 +157,7 @@ class MerakiModule(object):
response = self.request('/organizations', method='GET')
if self.status != 200:
self.fail_json(msg='Organization lookup failed')
self.orgs = self.request('/organizations', method='GET')
self.orgs = response
return self.orgs
def is_org_valid(self, data, org_name=None, org_id=None):
@ -205,7 +205,7 @@ class MerakiModule(object):
r = self.request(path, method='GET')
if self.status != 200:
self.fail_json(msg='Network lookup failed')
self.nets = self.request(path, method='GET')
self.nets = r
templates = self.get_config_templates(org_id)
for t in templates:
self.nets.append(t)

Loading…
Cancel
Save