From a850ddeac7376b0f1a63dc269746197f2e56788c Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 8 Sep 2009 22:12:01 -0400 Subject: Add function to send files to the server --- rpmbuild-remote.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'rpmbuild-remote.py') diff --git a/rpmbuild-remote.py b/rpmbuild-remote.py index 271a38f..1dcadb5 100644 --- a/rpmbuild-remote.py +++ b/rpmbuild-remote.py @@ -103,6 +103,12 @@ def read_preferences(opts): system['port'] = opts.port return system +def send_files(session, files, dest): + sftp = session.open_sftp() + for file in files: + LOG.info("Writing %s to server (%s)" % (file, dest)) + sftp.put(file, dest) + def execute_jobs(opts, system, jobs): session = paramiko.SSHClient() session.connect(system['host'], port=system['port'], -- cgit