saltstack-virtualenv.managed-报错及解决方案

报错内容:


      ID: .create restapi virtualenv
Function: virtualenv.managed
    Name: /home/
  Result: False
 Comment: An exception occurred in this state: Traceback (most recent call last):
            File "/usr/lib/python2.7/site-packages/salt/state.py", line 1933, in call
              **cdata['kwargs'])
            File "/usr/lib/python2.7/site-packages/salt/loader.py", line 1951, in wrapper
              return f(*args, **kwargs)
            File "/usr/lib/python2.7/site-packages/salt/states/virtualenv_mod.py", line 209, in managed
              **kwargs
            File "/usr/lib/python2.7/site-packages/salt/modules/virtualenv_mod.py", line 163, in create
              virtualenv.virtualenv_version)
          AttributeError: 'module' object has no attribute 'virtualenv_version'
 Started: 15:05:38.571037
Duration: 77.911 ms
 Changes:   

解决办法:

https://github.com/saltstack/salt/blob/master/salt/modules/virtualenv_mod.py#L55
下载这个模块替换当前报错路径的模块
cp -f  virtualenv_mod.py /usr/lib/python2.7/site-packages/salt/modules/virtualenv_mod.py

Git提问:

https://github.com/saltstack/salt/issues/56238

原因:

代码bug,已修复

你可能感兴趣的:(saltstack-virtualenv.managed-报错及解决方案)