我运行以下内容:
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'
我不能使用结构核心吗?
简短的答案是没有。 Connection.put
是just a wrapper周围的Transfer.put
,并且Transfer.put
only has three parameters:(1)local
,(2)remote
和(3)preserve_mode
。