mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 22:33:25 +00:00
[PR #11396/c8356981 backport][stable-12] move imports from functions to the top of the file (#11399)
move imports from functions to the top of the file (#11396)
* move imports from functions to the top of the file
* add changelog frag
* Apply suggestions from code review
---------
(cherry picked from commit c8356981bb)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
@@ -269,6 +269,7 @@ images:
|
||||
name: SampleName
|
||||
"""
|
||||
|
||||
import re
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.opennebula import OpenNebulaModule
|
||||
|
||||
@@ -345,8 +346,6 @@ class ImageInfoModule(OpenNebulaModule):
|
||||
pool = self.get_all_images()
|
||||
|
||||
if name_pattern.startswith("~"):
|
||||
import re
|
||||
|
||||
if name_pattern[1] == "*":
|
||||
pattern = re.compile(name_pattern[2:], re.IGNORECASE)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user