首页 > 代码库 > 一次ansible故障排除

一次ansible故障排除

运行ansbile时候报错:
[root@localhost pyhook-2014-06-09-17:47:17-2454]# ansible
Traceback (most recent call last):
  File "/usr/bin/ansible", line 25, in <module>
    from ansible.runner import Runner
  File "/usr/lib/python2.6/site-packages/ansible/runner/__init__.py", line 37, in <module>
    import ansible.inventory
  File "/usr/lib/python2.6/site-packages/ansible/inventory/__init__.py", line 27, in <module>
    from ansible.inventory.ini import InventoryParser
  File "/usr/lib/python2.6/site-packages/ansible/inventory/ini.py", line 21, in <module>
    from ansible.inventory.host import Host
  File "/usr/lib/python2.6/site-packages/ansible/inventory/host.py", line 19, in <module>
    from ansible import utils
  File "/usr/lib/python2.6/site-packages/ansible/utils/__init__.py", line 88, in <module>
    from keyczar.keys import AesKey
  File "/usr/lib/python2.6/site-packages/keyczar/keys.py", line 34, in <module>
    from Crypto.PublicKey import DSA
  File "/usr/lib64/python2.6/site-packages/Crypto/PublicKey/DSA.py", line 88, in <module>
    from Crypto.PublicKey import _DSA, _slowmath, pubkey
  File "/usr/lib64/python2.6/site-packages/Crypto/PublicKey/_DSA.py", line 30, in <module>
    from Crypto.PublicKey.pubkey import *
  File "/usr/lib64/python2.6/site-packages/Crypto/PublicKey/pubkey.py", line 30, in <module>
    from Crypto.Util.number import *
  File "/usr/lib64/python2.6/site-packages/Crypto/Util/number.py", line 56, in <module>
    if _fastmath is not None and not _fastmath.HAVE_DECL_MPZ_POWM_SEC:
AttributeError: ‘module‘ object has no attribute ‘HAVE_DECL_MPZ_POWM_SEC‘


解决方法:
 rpm -qa |grep python-crypto  把查到的全部删除
然后重新安装ansible
参考文章:http://stackoverflow.com/questions/20881768/fastmath-error-in-python-have-decl-mpz-powm-sec

本文出自 “yaoshenshen” 博客,谢绝转载!