Skip to content

Commit b65b6ae

Browse files
authored
Merge branch 'master' into multi-word-mask
2 parents b672eaf + 068a904 commit b65b6ae

File tree

99 files changed

+217
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+217
-7
lines changed

.ci/prep_azure.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@
8484
if need_to_fix_psycopg2:
8585
venv_steps.append('/tmp/venv/bin/pip3 install psycopg2==2.8.5 psycopg2-binary')
8686

87+
venv_steps.extend([
88+
# pbr is a transitive setup_requires of hdrhistogram. If it's not already
89+
# installed then setuptools attempts to use easy_install, which fails.
90+
'/tmp/venv/bin/pip install pbr==5.6.0',
91+
])
92+
8793
batches.append(venv_steps)
8894

8995
ci_lib.run_batches(batches)

ansible_mitogen/planner.py

Lines changed: 4 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
@@ -321,6 +322,7 @@ def get_module_deps(self):
321322
ALWAYS_FORK_MODULES = frozenset([
322323
'dnf', # issue #280; py-dnf/hawkey need therapy
323324
'firewalld', # issue #570: ansible module_utils caches dbus conn
325+
'ansible.legacy.dnf', # issue #776
324326
])
325327

326328
def should_fork(self):

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

tests/ansible/integration/action/copy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
- stat.results[1].stat.checksum == "62951f943c41cdd326e5ce2b53a779e7916a820d"
6464
- stat.results[2].stat.checksum == "b26dd6444595e2bdb342aa0a91721b57478b5029"
6565
- stat.results[3].stat.checksum == "d675f47e467eae19e49032a2cc39118e12a6ee72"
66+
fail_msg: stat={{stat}}
6667

6768
- file:
6869
state: absent

tests/ansible/integration/action/fixup_perms2__copy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
- assert:
2222
that:
2323
- out.stat.mode in ("0644", "0664")
24+
fail_msg: out={{out}}
2425

2526
#
2627
# copy module (explicit mode).
@@ -37,6 +38,7 @@
3738
- assert:
3839
that:
3940
- out.stat.mode == "0400"
41+
fail_msg: out={{out}}
4042

4143
#
4244
# copy module (existing disk files, no mode).
@@ -63,6 +65,7 @@
6365
- assert:
6466
that:
6567
- out.stat.mode in ("0644", "0664")
68+
fail_msg: out={{out}}
6669

6770
#
6871
# copy module (existing disk files, preserve mode).
@@ -79,6 +82,7 @@
7982
- assert:
8083
that:
8184
- out.stat.mode == "1462"
85+
fail_msg: out={{out}}
8286

8387
#
8488
# copy module (existing disk files, explicit mode).
@@ -96,6 +100,7 @@
96100
- assert:
97101
that:
98102
- out.stat.mode == "1461"
103+
fail_msg: out={{out}}
99104

100105
- file:
101106
state: absent

tests/ansible/integration/action/low_level_execute_command.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- 'raw.rc == 0'
1717
- 'raw.stdout_lines[-1]|to_text == "2"'
1818
- 'raw.stdout[-1]|to_text == "2"'
19+
fail_msg: raw={{raw}}
1920

2021
- name: Run raw module with sudo
2122
become: true
@@ -39,3 +40,4 @@
3940
["root\r\n"],
4041
["root"],
4142
)
43+
fail_msg: raw={{raw}}

tests/ansible/integration/action/make_tmp_path.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@
4444
assert:
4545
that:
4646
- good_temp_path == good_temp_path2
47+
fail_msg: good_temp_path={{good_temp_path}} good_temp_path2={{good_temp_path2}}
4748

4849
- name: "Verify different subdir for both tasks"
4950
assert:
5051
that:
5152
- tmp_path.path != tmp_path2.path
53+
fail_msg: tmp_path={{tmp_path}} tmp_path2={{tmp_path2}}
5254

5355
#
5456
# Verify subdirectory removal.
@@ -69,6 +71,7 @@
6971
that:
7072
- not stat1.stat.exists
7173
- not stat2.stat.exists
74+
fail_msg: stat1={{stat1}} stat2={{stat2}}
7275

7376
#
7477
# Verify good directory persistence.
@@ -83,6 +86,7 @@
8386
assert:
8487
that:
8588
- stat.stat.exists
89+
fail_msg: stat={{stat}}
8690

8791
#
8892
# Write some junk into the temp path.
@@ -105,6 +109,7 @@
105109
- assert:
106110
that:
107111
- not out.stat.exists
112+
fail_msg: out={{out}}
108113

109114
#
110115
# root
@@ -123,6 +128,7 @@
123128
that:
124129
- tmp_path2.path != tmp_path_root.path
125130
- tmp_path2.path|dirname != tmp_path_root.path|dirname
131+
fail_msg: tmp_path_root={{tmp_path_root}} tmp_path2={{tmp_path2}}
126132

127133
#
128134
# readonly homedir
@@ -153,3 +159,4 @@
153159
that:
154160
- out.module_path.startswith(good_temp_path2)
155161
- out.module_tmpdir.startswith(good_temp_path2)
162+
fail_msg: out={{out}}

tests/ansible/integration/action/remote_expand_user.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
register: out
2828
- assert:
2929
that: out.result == '{{user_facts.ansible_facts.ansible_user_dir}}/foo'
30+
fail_msg: out={{out}}
3031

3132
- name: "Expand ~/foo with become active. ~ is become_user's home."
3233
action_passthrough:
@@ -49,6 +50,7 @@
4950
register: out
5051
- assert:
5152
that: out.result == '{{user_facts.ansible_facts.ansible_user_dir}}/foo'
53+
fail_msg: out={{out}}
5254

5355
- name: "Expanding $HOME/foo has no effect."
5456
action_passthrough:
@@ -59,6 +61,7 @@
5961
register: out
6062
- assert:
6163
that: out.result == '$HOME/foo'
64+
fail_msg: out={{out}}
6265

6366
# ------------------------
6467

@@ -71,6 +74,7 @@
7174
register: out
7275
- assert:
7376
that: out.result == '{{user_facts.ansible_facts.ansible_user_dir}}/foo'
77+
fail_msg: out={{out}}
7478

7579
- name: "sudoable; Expand ~/foo with become active. ~ is become_user's home."
7680
action_passthrough:
@@ -94,6 +98,7 @@
9498
register: out
9599
- assert:
96100
that: out.result == '{{user_facts.ansible_facts.ansible_user_dir}}/foo'
101+
fail_msg: out={{out}}
97102

98103
- name: "sudoable; Expanding $HOME/foo has no effect."
99104
action_passthrough:
@@ -104,3 +109,4 @@
104109
register: out
105110
- assert:
106111
that: out.result == '$HOME/foo'
112+
fail_msg: out={{out}}

tests/ansible/integration/action/remote_file_exists.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
- assert:
1717
that: out.result == False
18+
fail_msg: out={{out}}
1819

1920
# ---
2021

@@ -29,6 +30,7 @@
2930

3031
- assert:
3132
that: out.result == True
33+
fail_msg: out={{out}}
3234

3335
- file:
3436
path: /tmp/does-exist

tests/ansible/integration/action/remove_tmp_path.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
- assert:
2424
that:
2525
- not out2.stat.exists
26+
fail_msg: out={{out}}
2627

2728
- stat:
2829
path: "{{out.src|dirname}}"
@@ -31,6 +32,7 @@
3132
- assert:
3233
that:
3334
- not out2.stat.exists
35+
fail_msg: out={{out}}
3436

3537
- file:
3638
path: /tmp/remove_tmp_path_test

0 commit comments

Comments
 (0)