2012-01-12 3 views
-5

paramiko와 함께 ssh를 사용하여 원격 시스템에서 명령을 실행할 때. 실행할 때 그것은 당신이 Transport 스트림 객체를 없어설명되지 않은 paramiko 오류

def execute(self,command): 
      to_exec = self.transport.open_session() 
      to_exec.exec_command(command) 
      stdout.write("\r%s" % "Executed") 
      stdout.flush() 

get_connection.execute('sh /etc/botclient/avail_pack.sh') 

File "/home/xxx/project/server/ssh_module.py", line 43, in execute 
    to_exec = self.transport.open_session() 
AttributeError: ssh_connection instance has no attribute 'transport' 
+0

질문에 대해 더 자세히 설명해야합니다. 아마도 당신의 문제에 대한 배경 지식을 제공 할 것입니다. – travega

+0

오류는 전송 속성이없는 자체 객체 (ssh_connection 객체)에서 발생합니다. 정보는 방금 게시 한 내용의 일부입니다. – danodonovan

답변

1

오류를 제공합니다. 어쩌면이 같은 self.transport = self.get_transport() 하나를 만들어보십시오 :

def execute(self,command): 
     self.transport = self.get_transport() 
     to_exec = self.transport.open_session() 
     to_exec.exec_command(command) 
     stdout.write("\r%s" % "Executed") 
     stdout.flush() 

get_connection.execute('sh /etc/botclient/avail_pack.sh') 

그건 당신이 우리에게 더 많은 정보를 제공해야합니다 작동하지 않으면 비록.

관련 문제