mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-02-03 23:41:51 +00:00
incus conn plugin: improve readability (was ruff: set target-python 3.7) (#11346)
* incus connection plugin: improve readability * add changelog frag * Update plugins/connection/incus.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/connection/incus.py * Update plugins/connection/incus.py Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
e8f2b135ba
commit
61d794f171
2 changed files with 8 additions and 4 deletions
|
|
@ -142,10 +142,12 @@ class Connection(ConnectionBase):
|
|||
]
|
||||
|
||||
if getattr(self._shell, "_IS_WINDOWS", False):
|
||||
if (
|
||||
(regex_match := self.powershell_regex_pattern.match(cmd))
|
||||
and (regex_pattern := self.powershell_regex_pattern)
|
||||
) or ((regex_match := self.cmd_regex_pattern.match(cmd)) and (regex_pattern := self.cmd_regex_pattern)):
|
||||
if regex_match := self.powershell_regex_pattern.match(cmd):
|
||||
regex_pattern = self.powershell_regex_pattern
|
||||
elif regex_match := self.cmd_regex_pattern.match(cmd):
|
||||
regex_pattern = self.cmd_regex_pattern
|
||||
|
||||
if regex_match:
|
||||
self._display.vvvvvv(
|
||||
f'Found keyword: "{regex_match.group("command")}" based on regex: {regex_pattern.pattern}',
|
||||
host=self._instance(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue