2011-02-06 23 views
1

我试图用织物0.92远程解压文件,但我正在从paramiko接收EOF。Python 2.7织物/ 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,它们是相等的。当我登录到远程计算机时,我可以解压文件而不会出错。

+0

今天我使用fabric.contrib.project.upload_project得到了同样的错误,但也许你想使用upload_project,它会为你节省一些复杂性。我使用fabric.contrib.project.rsync_project代替它,因为它工作。也许这是一个bug.fab --version Fabric 1.3.2 – 2011-11-28 22:39:47

回答

0

在新的Fabric版本中,这仍然是一个问题吗?你也可以尝试在焦油上放下详细的标志。也许可能会淹没标准输出/标准输入管道。