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':
|
'current_state':
|
||||||
(
|
(
|
||||||
item.stdout_lines
|
item.stdout_lines
|
||||||
| select('search', '^\\s*Wake-on:')
|
| map('trim')
|
||||||
| map('regex_replace', '.*Wake-on:\\s*', '')
|
| select('match', '^Wake-on:')
|
||||||
|
| map('regex_replace', 'Wake-on:\\s*', '')
|
||||||
| first
|
| first
|
||||||
| default('unknown')
|
| default('unknown')
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user