Skip to content

Commit

Permalink
fix mitogen bug with distro 1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ivandeex committed Mar 28, 2022
1 parent f9671b8 commit fcb59c7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/mitogen-distro.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- mitogen/master.py.bak 2022-03-28 19:43:35.594371211 +0300
+++ mitogen/master.py 2022-03-28 19:44:28.250723494 +0300
@@ -653,8 +653,9 @@
return [], None, modpath

pkg = sys.modules.get(pkgname)
+ name = getattr(pkg, '__name__', None)
path = getattr(pkg, '__path__', None)
- if pkg and path:
+ if pkg and pkgname == name and path:
return pkgname.split('.'), path, modpath

LOG.debug('%r: %r lacks __path__ attribute', self, pkgname)
15 changes: 7 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,15 @@ jobs:
sudo -H python3 -m pip install -U pip setuptools wheel
sudo -H pip3 install -r ./molecule/default/requirements.txt
- name: make mitogen strategy symlink
- name: fix mitogen and molecule
run: |
PKG=$(python3 -c "import ansible_mitogen as m; print(m.__path__[0])")
ln -sf $PKG/plugins/strategy ./molecule/default/plugins/strategy/mitogen
- name: fix molecule-docker for mitogen
run: |
SRC=$(pwd)
PKG=$(python3 -c "import molecule_docker as m; print(m.__path__[0])")
sudo patch -d $PKG -p1 -i $SRC/.github/workflows/docker-mitogen.patch
VENV=$(dirname $PKG)
PWD=$(pwd)
SRC=$PWD/.github/workflows
sudo patch -d $VENV/molecule_docker -p1 -i $SRC/docker-mitogen.patch
sudo patch -d $VENV/mitogen -p1 -i $SRC/mitogen-distro.patch
ln -sf $PKG/plugins/strategy $PWD/molecule/default/plugins/strategy/mitogen
- name: let molecule detect current collection
run: |
Expand Down
6 changes: 2 additions & 4 deletions molecule/core/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ provisioner:
ANSIBLE_STRATEGY_PLUGINS: $MOLECULE_SCENARIO_DIRECTORY/../default/plugins/strategy/mitogen
config_options:
defaults:
strategy: linear
# strategy: mitogen_linear
strategy: ${ANSIBLE_STRATEGY:-mitogen_linear}
stdout_callback: unixy2
verbosity: 1
lint:
Expand Down Expand Up @@ -57,10 +56,9 @@ scenario:
- destroy
create_sequence:
- create
- prepare
destroy_sequence:
- cleanup
- destroy
- cleanup
converge_sequence:
- converge
...

0 comments on commit fcb59c7

Please sign in to comment.