Skip to content

Commit eae6bdd

Browse files
authored
Merge branch 'master' into issue852
2 parents cfa5888 + f5eb19e commit eae6bdd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

ansible_mitogen/planner.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import logging
4242
import os
4343
import random
44+
import re
4445

4546
from ansible.executor import module_common
4647
from ansible.collections.list import list_collection_dirs
@@ -297,11 +298,11 @@ class NewStylePlanner(ScriptPlanner):
297298
preprocessing the module.
298299
"""
299300
runner_name = 'NewStyleRunner'
300-
marker = b'from ansible.module_utils.'
301+
MARKER = re.compile(b'from ansible(?:_collections|\.module_utils)\.')
301302

302303
@classmethod
303304
def detect(cls, path, source):
304-
return cls.marker in source
305+
return cls.MARKER.search(source) != None
305306

306307
def _get_interpreter(self):
307308
return None, None

docs/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ v0.3.0 (unreleased)
2323
This release separates itself from the v0.2.X releases. Ansible's API changed too much to support backwards compatibility so from now on, v0.2.X releases will be for Ansible < 2.10 and v0.3.X will be for Ansible 2.10+.
2424
`See here for details <https://github.com/dw/mitogen pull/715#issuecomment-750697248>`_.
2525

26+
* :gh:issue:`827` NewStylePlanner: detect `ansible_collections` imports
2627
* :gh:issue:`770` better check for supported Ansible version
2728
* :gh:issue:`731` ansible 2.10 support
2829
* :gh:issue:`652` support for ansible collections import hook

0 commit comments

Comments
 (0)