refactor ♻️: Refactor regex and filter logic for Wake-on state extraction
All checks were successful
ansible-lint / Ansible Lint (push) Successful in 9s
All checks were successful
ansible-lint / Ansible Lint (push) Successful in 9s
Updated regular expression patterns and filtering mechanisms to more accurately extract the Wake-on state from system logs.
This commit is contained in:
@@ -60,8 +60,9 @@
|
||||
'current_state':
|
||||
(
|
||||
item.stdout_lines
|
||||
| select('search', '^\\s*Wake-on:')
|
||||
| map('regex_replace', '.*Wake-on:\\s*', '')
|
||||
| map('trim')
|
||||
| select('match', '^Wake-on:')
|
||||
| map('regex_replace', 'Wake-on:\\s*', '')
|
||||
| first
|
||||
| default('unknown')
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user