Move the parmiko import to work around a bug with python daemonization and paramiko.
This commit is contained in:
parent
5e81f999d1
commit
7adf37e6b5
1 changed files with 3 additions and 1 deletions
|
@ -5,7 +5,6 @@ import time
|
||||||
import argparse
|
import argparse
|
||||||
import digitalocean
|
import digitalocean
|
||||||
import requests
|
import requests
|
||||||
import paramiko
|
|
||||||
|
|
||||||
from apscheduler.scheduler import Scheduler
|
from apscheduler.scheduler import Scheduler
|
||||||
from multiprocessing.pool import ThreadPool
|
from multiprocessing.pool import ThreadPool
|
||||||
|
@ -109,6 +108,9 @@ def babysit_builder(request):
|
||||||
repository_build.phase = 'initializing'
|
repository_build.phase = 'initializing'
|
||||||
repository_build.save()
|
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 = paramiko.SSHClient()
|
||||||
ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||||
|
|
||||||
|
|
Reference in a new issue