Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OS X 'module' object has no attribute 'POLLIN' #542

Closed
enkov opened this Issue Feb 14, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@enkov
Copy link

commented Feb 14, 2019

  • Which version of Ansible are you running?
ansible 2.7.7
  ansible python module location = /Library/Python/2.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.10 (default, Aug 17 2018, 19:45:58) [GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.0.42)]
  • Is your version of Ansible patched in any way?
    No
  • Are you running with any custom modules, or module_utils loaded?
    No
  • Have you tried the latest master version from Git?
    Tested on the latest release version 0.2.5
  • Do you have some idea of what the underlying problem may be?
    I get this error:
Traceback (most recent call last):
  File "/usr/local/bin/ansible-playbook", line 118, in <module>
    exit_code = cli.run()
  File "/Library/Python/2.7/site-packages/ansible/cli/playbook.py", line 122, in run
    results = pbex.run()
  File "/Library/Python/2.7/site-packages/ansible/executor/playbook_executor.py", line 156, in run
    result = self._tqm.run(play=play)
  File "/Library/Python/2.7/site-packages/ansible/executor/task_queue_manager.py", line 270, in run
    strategy = strategy_loader.get(new_play.strategy, self)
  File "/Library/Python/2.7/site-packages/ansible/plugins/loader.py", line 378, in get
    self._module_cache[path] = self._load_module_source(name, path)
  File "/Library/Python/2.7/site-packages/ansible/plugins/loader.py", line 357, in _load_module_source
    module = imp.load_source(full_name, path, module_file)
  File "/Users/petrenkov/WORK/mitogen-0.2.5/ansible_mitogen/plugins/strategy/mitogen_linear.py", line 56, in <module>
    import ansible_mitogen.strategy
  File "/Users/petrenkov/WORK/mitogen-0.2.5/ansible_mitogen/strategy.py", line 34, in <module>
    import mitogen.core
  File "/Users/petrenkov/WORK/mitogen-0.2.5/mitogen/core.py", line 1887, in <module>
    class Poller(object):
  File "/Users/petrenkov/WORK/mitogen-0.2.5/mitogen/core.py", line 1958, in Poller
    _readmask = select.POLLIN | select.POLLHUP
AttributeError: 'module' object has no attribute 'POLLIN'
  • Mention your host and target OS and versions
    Host OS: macOS Mojave 10.14.3
    Target OS: ubuntu 16.04
  • Mention your host and target Python versions
    host python version: 2.7.15
    target python version: 2.7.12
@dw

This comment has been minimized.

Copy link
Owner

commented Feb 14, 2019

It seems the version of Python that ships with OS X does not support POLLIN. The versions shipped in Homebrew have it enabled.

This means MacOS targets are broken too. I will re-add support for select.select. Thanks for reporting!

@enkov

This comment has been minimized.

Copy link
Author

commented Feb 14, 2019

Thank for the fast reply!
I set ansible to use python from the brew and everything works!
Thanks again!

dw added a commit that referenced this issue Feb 14, 2019

@dw dw closed this in 2cde51e Feb 14, 2019

dw added a commit that referenced this issue Feb 14, 2019

Merge remote-tracking branch 'origin/azure3'
* origin/azure3:
  docs: update Changelog; closes #542.
  issue #542: return of select poller, new selection logic
  issue #542: .ci: move some tests to Azure and enable Mac job.
  ansible: create stub __init__.py for sdist.
@dw

This comment has been minimized.

Copy link
Owner

commented Feb 14, 2019

This is now on the master branch and will make it into the next release. To be updated when a new release is made, subscribe to https://www.freelists.org/list/mitogen-announce

Thanks for reporting this!

dw added a commit that referenced this issue Mar 6, 2019

Merge remote-tracking branch 'origin/026' into stable
* origin/026:
  docs: update Changelog for release.
  Bump version for release.
  issue #555: ansible: workaround ancient reload(sys) hack.
  issue #554: mitogen_action_script fix
  issue #554: fix Ansible 2.4 compatibility
  issue #554: don't rely on tmp_path autoremoval in test.
  issue #554: track and remove multiple make_tmp_path() calls.
  docs: update Changelog.
  docs: drastically simplify install/changelog.
  issue #552: include process identity in log messages.
  issue #550: update Changelog.
  issue #550: parent: add explanatory comment.
  issue #550: fix up TTY ioctls on WSL 2016 Anniversary Update
  docs: update Changelog.
  service: make service list optional.
  docs: update Changelog; closes #548.
  issue #548: always treat transport=smart as 'ssh' for mitogen_via=.
  docs: better intro paragraph.
  .ci: copy private key file to tempdir.
  os_fork: more doc tweaks
  os_fork: more doc tweaks
  os_fork: yet more doc tidyup
  os_fork: more doc tweaks
  os_fork: clean up docs
  .ci: import soak scripts.
  .ci: allow containers for different jobs to run simultaneously
  os_fork: python 3 fixes and tests.
  issue #535: activate Corker on 2.4 in master too.
  issue #535: update Changelog.
  issue #535: wire mitogen.os_fork into Broker and Pool.
  issue #535: parent: add create_socketpair(size=..) parameter.
  issue #535: introduce mitogen.os_fork module and Corker class.
  issue #535: docs: update Changelog
  issue #535: service: support Pool.defer() like Broker.defer()
  issue #535: core: unicode.encode() may take importer lock on 2.x
  issue #535: docs: fix up Select doc
  issue #535: docs: update Changelog.
  issue #535: core/select: support selecting from Latches.
  core: increase cookie field lengths to 64-bit; closes #545.
  tests: ensure serialization restrictions are in effect
  tests/bench: set process affinity in throughput.py.
  docs: update copyright year.
  docs: update Changelog.
  core: Make Latch.put(obj=) optional.
  docs: change 'unreleased' Changelog format and add a hint.
  docs: update Changelog; closes #542.
  issue #542: return of select poller, new selection logic
  issue #542: .ci: move some tests to Azure and enable Mac job.
  ansible: create stub __init__.py for sdist.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.