(self,host,f,dst_dir = "~/",timeout = None)
| 241 | return True,None |
| 242 | |
| 243 | def copy_file(self,host,f,dst_dir = "~/",timeout = None): |
| 244 | p = ConnectProxy(host,self.user) |
| 245 | try: |
| 246 | if len(self.keyfile): |
| 247 | p.connect_with_pkey(self.keyfile,timeout) |
| 248 | else: |
| 249 | p.connect(self.pwd,timeout = timeout) |
| 250 | except Exception as e: |
| 251 | print("[copy_file] connect to %s error: " % host,e) |
| 252 | p.close() |
| 253 | return False,None |
| 254 | try: |
| 255 | p.copy_file(f,dst_dir) |
| 256 | except Exception as e: |
| 257 | print("[copy_file] copy %s error " % host,e) |
| 258 | p.close() |
| 259 | return False,None |
| 260 | if p: |
| 261 | p.close() |
| 262 | |
| 263 | return True,None |
| 264 | |
| 265 | def execute_w_channel(self,cmd,host,dir,timeout = None): |
| 266 | p = ConnectProxy(host,self.user) |
nothing calls this directly
no test coverage detected