From 4cef6d78f82159ce78380a67e73ae17242f7fa07 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 8 Sep 2009 22:18:01 -0400 Subject: Add logging messages --- rpmbuild-remote.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'rpmbuild-remote.py') diff --git a/rpmbuild-remote.py b/rpmbuild-remote.py index f751242..9631e83 100644 --- a/rpmbuild-remote.py +++ b/rpmbuild-remote.py @@ -110,24 +110,29 @@ def send_files(session, files, dest): def execute_jobs(opts, system, jobs): session = paramiko.SSHClient() + LOG.info("Connecting to %(user)s@%(host)s:%(port)d" % system) session.connect(system['host'], port=system['port'], username=system['user'], key_filename=system['ssh_key']) for job in jobs: if type(job) == type(''): dest = "rpmbuild/SRPMS/" send_files(session, [job], dest) + file = os.path.basename(job) if opts.mock is None: - cmd = "rpmbuild --rebuild rpmbuild/SRPMS/%s" - % os.path.basename(job) + LOG.info("Building %s" % file) + cmd = "rpmbuild --rebuild rpmbuild/SRPMS/%s" % file else: + LOG.info("Building %s with mock config %s" % (file, opts.mock)) cmd = "mock -r %s rpmbuild/SRPMS/%s" - % (opts.mock, os.path.basename(job)) + % (opts.mock, file) else: dest = "rpmbuild/SPECS" send_files(session, [jobs[0]], dest) dest = "rpmbuild/SOURCES" send_files(session, jobs[1:], dest) - cmd = "rpmbuild -ba rpmbuild/SPECS/%s" % os.path.basename(jobs[0]) + file = os.path.basename(jobs[0]) + LOG.info("Building %s from %d souces" % (file, len(job) - 1)) + cmd = "rpmbuild -ba rpmbuild/SPECS/%s" % file) files = session.exec_command(cmd) # Write output files # Fetch RPM files -- cgit