You've already forked community.general
mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-01 06:06:57 +03:00
snap: fix regex to support option values with whitespaces (#5475)
* snap: fix regex to support option values with whitespaces * add changelog fragment
This commit is contained in:
@ -170,7 +170,7 @@ def _state_map(value):
|
||||
|
||||
class Snap(CmdStateModuleHelper):
|
||||
__disable_re = re.compile(r'(?:\S+\s+){5}(?P<notes>\S+)')
|
||||
__set_param_re = re.compile(r'(?P<snap_prefix>\S+:)?(?P<key>\S+)=(?P<value>\S+)')
|
||||
__set_param_re = re.compile(r'(?P<snap_prefix>\S+:)?(?P<key>\S+)\s*=\s*(?P<value>.+)')
|
||||
module = dict(
|
||||
argument_spec={
|
||||
'name': dict(type='list', elements='str', required=True),
|
||||
@ -342,7 +342,7 @@ class Snap(CmdStateModuleHelper):
|
||||
|
||||
if selected_snap_name is None or (snap_name is not None and snap_name == selected_snap_name):
|
||||
key = match.group("key")
|
||||
value = match.group("value")
|
||||
value = match.group("value").strip()
|
||||
|
||||
if key not in option_map or key in option_map and option_map[key] != value:
|
||||
option_without_prefix = key + "=" + value
|
||||
|
Reference in New Issue
Block a user