关于作者

Discuss / Python / fab deploy错误 AttributeError: 'str' object has no attribute 'get'

fab deploy错误 AttributeError: 'str' object has no attribute 'get'

问题来源

凯旋不败

#1 Created at ...

我在centos7里尝试部署时出现了如下的错误,诸位能帮看看这错误是什么原因:

[10.10.10.129] Executing task 'deploy' [10.10.10.129] run: rm -f /tmp/dist-awesome.tar.gz Traceback (most recent call last): File "/usr/lib64/python2.7/site-packages/fabric/main.py", line 757, in main args, **kwargs File "/usr/lib64/python2.7/site-packages/fabric/tasks.py", line 386, in execute multiprocessing File "/usr/lib64/python2.7/site-packages/fabric/tasks.py", line 276, in _execute return task.run(args, kwargs) File "/usr/lib64/python2.7/site-packages/fabric/tasks.py", line 173, in run return self.wrapped(*args, kwargs) File "/srv/awesome/fabfile.py", line 77, in deploy run('rm -f %s' % _REMOTE_TMP_TAR) File "/usr/lib64/python2.7/site-packages/fabric/network.py", line 687, in host_prompting_wrapper return func(args, *kwargs) File "/usr/lib64/python2.7/site-packages/fabric/operations.py", line 1090, in run shell_escape=shell_escape, capture_buffer_size=capture_buffer_size, File "/usr/lib64/python2.7/site-packages/fabric/operations.py", line 930, in _run_command channel=default_channel(), command=wrapped_command, pty=pty, File "/usr/lib64/python2.7/site-packages/fabric/state.py", line 424, in default_channel chan = _open_session() File "/usr/lib64/python2.7/site-packages/fabric/state.py", line 416, in _open_session return connections[env.host_string].get_transport().open_session() File "/usr/lib64/python2.7/site-packages/fabric/network.py", line 159, in getitem self.connect(key) File "/usr/lib64/python2.7/site-packages/fabric/network.py", line 151, in connect user, host, port, cache=self, seek_gateway=seek_gateway) File "/usr/lib64/python2.7/site-packages/fabric/network.py", line 445, in connect password = get_password(user, host, port, login_only=True) File "/usr/lib64/python2.7/site-packages/fabric/auth.py", line 11, in get_password login_password = env.passwords.get(host_string, env.password) AttributeError: 'str' object has no attribute 'get'

错误定位的位置很奇怪,谢谢大家的帮助了

凯旋不败

#2 Created at ...

配置文件的问题


  • 1

Reply

WARNING: You are using an old browser that does not support HTML5. Please choose a modern browser (Chrome / Microsoft Edge / Firefox / Sarafi) to get a good experience.