mirror of
https://github.com/ansible-collections/community.routeros.git
synced 2025-06-21 09:35:45 +02:00
Allow to declare some versions as unsupported, and to provide an explicit message. (#238)
This commit is contained in:
parent
eda8f64e8d
commit
ac89aa0ab7
3 changed files with 27 additions and 11 deletions
|
@ -1133,8 +1133,12 @@ def main():
|
|||
versioned_path_info = PATHS.get(tuple(path))
|
||||
if versioned_path_info.needs_version:
|
||||
api_version = get_api_version(api)
|
||||
if not versioned_path_info.provide_version(api_version):
|
||||
module.fail_json(msg='Path /{path} is not supported for API version {api_version}'.format(path='/'.join(path), api_version=api_version))
|
||||
supported, not_supported_msg = versioned_path_info.provide_version(api_version)
|
||||
if not supported:
|
||||
msg = 'Path /{path} is not supported for API version {api_version}'.format(path='/'.join(path), api_version=api_version)
|
||||
if not_supported_msg:
|
||||
msg = '{0}: {1}'.format(msg, not_supported_msg)
|
||||
module.fail_json(msg=msg)
|
||||
path_info = versioned_path_info.get_data()
|
||||
|
||||
backend = get_backend(path_info)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue