TypeError:put()得到了意外的关键字参数'use_sudo'

问题描述 投票:0回答:1

我运行以下内容:

 c = Connection('sid', config=config) 
 c.put("local", "/etc/nginx/sites-available/addr", use_sudo=True) 

我知道

~/.virtualenvs/fabric/lib/python3.7/site-packages/fabric/connection.py in put(self, *args, **kwargs)
    784         .. versionadded:: 2.0
    785         """
--> 786         return Transfer(self).put(*args, **kwargs)
    787 
    788     # TODO: yield the socket for advanced users? Other advanced use cases

TypeError: put() got an unexpected keyword argument 'use_sudo'

我不能使用结构核心吗?

python fabric
1个回答
0
投票

简短的答案是没有。 Connection.putjust a wrapper周围的Transfer.put,并且Transfer.put only has three parameters:(1)local,(2)remote和(3)preserve_mode

© www.soinside.com 2019 - 2024. All rights reserved.