Move the parmiko import to work around a bug with python daemonization and paramiko.

This commit is contained in:
yackob03 2013-10-29 18:56:57 -04:00
parent 5e81f999d1
commit 7adf37e6b5

View file

@ -5,7 +5,6 @@ import time
import argparse
import digitalocean
import requests
import paramiko
from apscheduler.scheduler import Scheduler
from multiprocessing.pool import ThreadPool
@ -109,6 +108,9 @@ def babysit_builder(request):
repository_build.phase = 'initializing'
repository_build.save()
# We wait until here to import paramiko because otherwise it doesn't work
# under the daemon context.
import paramiko
ssh_client = paramiko.SSHClient()
ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())