Skip to content

Commit

Permalink
Add changelog fragment and lint (ansible-collections#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrimee committed Mar 22, 2023
1 parent 5f0caeb commit 25b905c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/161-workaround-prompt-with-space.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
minor_changes:
- command - workaround for extra characters in stdout (#62) in RouterOS versions between 6.49 and 7.1.5
(https://github.com/ansible-collections/community.routeros/pull/161).
5 changes: 2 additions & 3 deletions plugins/module_utils/routeros.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,10 @@ def should_add_leading_space(module):
"""Determines whether adding a leading space to the command is needed
to workaround prompt bug in 6.49 <= ROS < 7.2"""
capabilities = get_capabilities(module)
network_os_version = capabilities.get('device_info',{}).get('network_os_version')
network_os_version = capabilities.get('device_info', {}).get('network_os_version')
if network_os_version is None:
return False
version = LooseVersion(network_os_version)
return (version >= LooseVersion('6.49')) and (version < LooseVersion('7.2'))
return LooseVersion('6.49') <= LooseVersion(network_os_version) < LooseVersion('7.2')

def run_commands(module, commands, check_rc=True):
responses = list()
Expand Down

0 comments on commit 25b905c

Please sign in to comment.