From f88f5b740430906b93aa2b4080caad2221a9660a Mon Sep 17 00:00:00 2001 From: Ciaran Gultnieks Date: Sat, 18 Feb 2012 10:38:49 +0000 Subject: [PATCH] Some more wip on build server integration --- build.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index 5356aac6..fc97f058 100755 --- a/build.py +++ b/build.py @@ -147,15 +147,18 @@ for app in apps: # Load and parse the SSH config... sshconfig = paramiko.SSHConfig() - sshconfig.parse('builder/sshconfig') + sshf = open('builder/sshconfig', 'r') + sshconfig.parse(sshf) + sshf.close() sshconfig = sshconfig.lookup(vagranthost) # Open SSH connection... ssh = paramiko.SSHClient() - ssh.set_missing_host_key_policy(paramiko.AcceptPolicy) - ssh.connect(sshconfig['HostName'], username=sshconfig['Username'], - port=sshconfig['Port'], timeout=10, look_for_keys=False, - key_filename=sshconfig['IdentityFile']) + ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + print sshconfig + ssh.connect(sshconfig['hostname'], username=sshconfig['user'], + port=int(sshconfig['port']), timeout=10, look_for_keys=False, + key_filename=sshconfig['identityfile']) # Get an SFTP connection... ftp = ssh.open_sftp() @@ -178,7 +181,7 @@ for app in apps: lastdir = r for ff in f: ftp.put(os.path.join(r, ff), ff) - ftp.send_dir(app['id']) + send_dir(app['id']) # TODO: send relevant extlib directories too ftp.chdir('/home/vagrant')