Removed any temporary get_net() methods (#42391)
- Made appropriate changes where needed
This commit is contained in:
parent
e9bf3c70e6
commit
a65d9257fd
2 changed files with 6 additions and 20 deletions
|
@ -249,13 +249,6 @@ def network_factory(meraki, networks, nets):
|
|||
return networks_new
|
||||
|
||||
|
||||
def get_nets_temp(meraki, org_id): # Function won't be needed when get_nets is added to util
|
||||
path = meraki.construct_path('get_all', function='network', org_id=org_id)
|
||||
response = meraki.request(path, method='GET')
|
||||
if meraki.status == 200:
|
||||
return response
|
||||
|
||||
|
||||
def create_admin(meraki, org_id, name, email):
|
||||
payload = dict()
|
||||
payload['name'] = name
|
||||
|
@ -268,7 +261,7 @@ def create_admin(meraki, org_id, name, email):
|
|||
if meraki.params['tags'] is not None:
|
||||
payload['tags'] = json.loads(meraki.params['tags'])
|
||||
if meraki.params['networks'] is not None:
|
||||
nets = get_nets_temp(meraki, org_id)
|
||||
nets = meraki.get_nets(org_id=org_id)
|
||||
networks = network_factory(meraki, meraki.params['networks'], nets)
|
||||
# meraki.fail_json(msg=str(type(networks)), data=networks)
|
||||
payload['networks'] = networks
|
||||
|
|
|
@ -219,13 +219,6 @@ def get_org_devices(meraki, org_id):
|
|||
return response
|
||||
|
||||
|
||||
def temp_get_nets(meraki, org_name, net_name):
|
||||
org_id = meraki.get_org_id(org_name)
|
||||
path = meraki.construct_path('get_all', function='network', org_id=org_id)
|
||||
r = meraki.request(path, method='GET')
|
||||
return r
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
# define the available arguments/parameters that a user can pass to
|
||||
|
@ -300,14 +293,14 @@ def main():
|
|||
|
||||
# manipulate or modify the state as needed (this is going to be the
|
||||
# part where your module will do what it needs to do)
|
||||
|
||||
org_id = meraki.params['org_id']
|
||||
if org_id is None:
|
||||
org_id = meraki.get_org_id(meraki.params['org_name'])
|
||||
nets = meraki.get_nets(org_id=org_id)
|
||||
net_id = None
|
||||
if meraki.params['net_id'] or meraki.params['net_name']:
|
||||
net_id = meraki.params['net_id']
|
||||
if net_id is None:
|
||||
if meraki.params['net_name']:
|
||||
nets = temp_get_nets(meraki, meraki.params['org_name'], meraki.params['net_name'])
|
||||
net_id = meraki.get_net_id(net_name=meraki.params['net_name'], data=nets)
|
||||
|
||||
if meraki.params['state'] == 'query':
|
||||
|
|
Loading…
Reference in a new issue