Meraki module utility - get_net() downloads networks if data isn't provided (#41423)

* Enable get_net() to download nets if data isn't provided

- Currently, get_net() requires data to be passed to it
- PR enables get_net() to download all networks if data isn't passed
- Slightly simpler code
- Best practice is to download nets early in execution

* Apply fixes related to get_net()

* Removed extra code from the rebase
This commit is contained in:
Kevin Breit
2018-07-09 04:13:38 -05:00
committed by Dag Wieers
parent eeada86554
commit ca5f9aab1e
2 changed files with 12 additions and 15 deletions

View File

@@ -206,7 +206,7 @@ def main():
elif meraki.params['net_name'] or meraki.params['net_id'] is not None:
meraki.result['data'] = meraki.get_net(meraki.params['org_name'],
meraki.params['net_name'],
nets
data=nets
)
elif meraki.params['state'] == 'present':
if meraki.params['net_name']: # FIXME: Idempotency check is ugly here, improve