![](/img/trans.png)
[英]Paramiko : Throwing error when trying to execute python on remote server
[英]Python 2.7 fabric/paramiko EOF when trying to untar a remote file
我正在嘗試使用Fabric 0.92遠程解壓縮文件,但正在從paramiko接收EOF。
def deployFile(self, localdir, remoteroot, filename):
log.info('Deploying file {0} to host {1}...'.format(filename, self.host))
env.password = self.password
env.disable_known_hosts = True
localFile=localdir+"/"+filename
remoteFile='/tmp/{0}'.format(filename)
with settings(host_string = self.connectstring):
log.info('...putting {0}'.format(filename))
put(localFile, "/tmp/", mode=0755)
with cd(remoteroot):
untar='tar zxvf {0}'.format(remoteFile)
log.info('...untarring {0}'.format(filename))
#paramiko.util.log_to_file('paramiko.out')
sudo(untar, pty=True)
我從paramiko.out輸出:
DEB [20110205-20:49:36.782] thr=1 paramiko.transport: [chan 8] Max packet in: 34816 bytes
DEB [20110205-20:49:36.784] thr=2 paramiko.transport: [chan 7] EOF received (7)
DEB [20110205-20:49:36.785] thr=2 paramiko.transport: [chan 8] Max packet out: 32768 bytes
INF [20110205-20:49:36.785] thr=2 paramiko.transport: Secsh channel 8 opened.
DEB [20110205-20:49:36.788] thr=2 paramiko.transport: EOF in transport thread
我可以使用結構執行其他sudo命令,但是打開文件似乎會中斷。 我已經比較了本地文件和遠程文件的md5sum,它們相等。 登錄遠程計算機時,我可以將文件解壓縮而不會出現錯誤。
這對於您來說是新的Fabric版本中的問題嗎? 另外,您可以嘗試將詳細標志放在tar上。 可能正在充斥stdout / stdin管道。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.