mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Meraki utility - construct_path() now supports custom keys (#42286)
* construct_path() now supports custom keys - Allows for much more flexible test substitution - Implemented functionality in meraki_vlan for test case * Fix comments for PEP8
This commit is contained in:
@@ -249,7 +249,7 @@ class MerakiModule(object):
|
||||
return template['id']
|
||||
self.fail_json(msg='No configuration template named {0} found'.format(name))
|
||||
|
||||
def construct_path(self, action, function=None, org_id=None, net_id=None, org_name=None):
|
||||
def construct_path(self, action, function=None, org_id=None, net_id=None, org_name=None, custom=None):
|
||||
"""Build a path from the URL catalog.
|
||||
|
||||
Uses function property from class for catalog lookup.
|
||||
@@ -261,8 +261,10 @@ class MerakiModule(object):
|
||||
built_path = self.url_catalog[action][function]
|
||||
if org_name:
|
||||
org_id = self.get_org_id(org_name)
|
||||
|
||||
built_path = built_path.format(org_id=org_id, net_id=net_id)
|
||||
if custom:
|
||||
built_path = built_path.format(org_id=org_id, net_id=net_id, **custom)
|
||||
else:
|
||||
built_path = built_path.format(org_id=org_id, net_id=net_id)
|
||||
return built_path
|
||||
|
||||
def request(self, path, method=None, payload=None):
|
||||
|
||||
Reference in New Issue
Block a user