Revision 2c094917
b/tools/ganeti-listrunner | ||
---|---|---|
267 | 267 |
sftp = paramiko.SFTPClient.from_transport(connection) |
268 | 268 |
sftp.mkdir(remote_dir, mode=0700) |
269 | 269 |
for item in filelist: |
270 |
remote_file = "%s/%s" % (remote_dir, item.split("/").pop())
|
|
270 |
remote_file = "%s/%s" % (remote_dir, os.path.basename(item))
|
|
271 | 271 |
WriteLog("uploading %s to remote %s" % (item, remote_file), logfile) |
272 | 272 |
sftp.put(item, remote_file) |
273 | 273 |
if item == executable: |
... | ... | |
287 | 287 |
try: |
288 | 288 |
sftp = paramiko.SFTPClient.from_transport(connection) |
289 | 289 |
for item in filelist: |
290 |
fullpath = "%s/%s" % (upload_dir, item.split("/").pop())
|
|
290 |
fullpath = "%s/%s" % (upload_dir, os.path.basename(item))
|
|
291 | 291 |
WriteLog("removing remote %s" % fullpath, logfile) |
292 | 292 |
sftp.remove(fullpath) |
293 | 293 |
sftp.rmdir(upload_dir) |
... | ... | |
337 | 337 |
select.select([], [], [], .1) |
338 | 338 |
|
339 | 339 |
WriteLog("SUCCESS: command output follows", logfile) |
340 |
for line in output.split("\n"):
|
|
340 |
for line in output.splitlines():
|
|
341 | 341 |
WriteLog("output = %s" % line, logfile) |
342 | 342 |
WriteLog("command execution completed", logfile) |
343 | 343 |
session.close() |
... | ... | |
375 | 375 |
print " %s: uploading files" % hostname |
376 | 376 |
upload_dir = UploadFiles(connection, executable, |
377 | 377 |
filelist, logfile) |
378 |
command = "cd %s && ./%s" % (upload_dir, |
|
379 |
executable.split("/").pop()) |
|
378 |
command = "cd %s && ./%s" % (upload_dir, os.path.basename(executable)) |
|
380 | 379 |
print " %s: executing remote command" % hostname |
381 | 380 |
cmd_result = RunRemoteCommand(connection, command, logfile) |
382 | 381 |
if cmd_result is True: |
Also available in: Unified diff