fix alternatives parsing when they are part of a group (#3976) (#4020)

* fix alternatives parsing when they are part of a group

* add changelog fragment

Co-authored-by: Guillaume Rousse <guillaume.rousse@renater.fr>
(cherry picked from commit a675afcba9)

Co-authored-by: Guillaume Rousse <guillomovitch@gmail.com>
pull/4034/head
patchback[bot] 2022-01-10 07:27:12 +01:00 committed by GitHub
parent 57b73e0d5e
commit d2b4151b7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -0,0 +1,2 @@
bugfixes:
- alternatives - fix output parsing for alternatives groups (https://github.com/ansible-collections/community.general/pull/3976).

View File

@ -104,7 +104,7 @@ def main():
# available alternatives
current_path_regex = re.compile(r'^\s*link currently points to (.*)$',
re.MULTILINE)
alternative_regex = re.compile(r'^(\/.*)\s-\spriority', re.MULTILINE)
alternative_regex = re.compile(r'^(\/.*)\s-\s(?:family\s\S+\s)?priority', re.MULTILINE)
match = current_path_regex.search(display_output)
if match: