fix: ssh parameters and import subprocess

This commit is contained in:
adobdin 2016-04-08 11:01:21 +00:00
parent 7b34445397
commit fd11d84149
3 changed files with 5 additions and 6 deletions

View File

@ -8,9 +8,9 @@ class Conf(object):
"""Configuration parameters""" """Configuration parameters"""
hard_filter = None hard_filter = None
soft_filter = NodeFilter() soft_filter = NodeFilter()
ssh = {'opts': '''-oConnectTimeout=2 -oStrictHostKeyChecking=no ssh = {'opts': ('-oConnectTimeout=2 -oStrictHostKeyChecking=no '
-oUserKnownHostsFile=/dev/null -oLogLevel=error '-oUserKnownHostsFile=/dev/null -oLogLevel=error '
-lroot -oBatchMode=yes''', '-lroot -oBatchMode=yes'),
'vars': 'OPENRC=/root/openrc IPTABLES_STR="iptables -nvL"'} 'vars': 'OPENRC=/root/openrc IPTABLES_STR="iptables -nvL"'}
cluster = None cluster = None
fuelip = 'localhost' fuelip = 'localhost'

View File

@ -28,7 +28,6 @@ import threading
import re import re
from tools import * from tools import *
ckey = 'cmds' ckey = 'cmds'
fkey = 'files' fkey = 'files'
lkey = 'logs' lkey = 'logs'
@ -263,6 +262,7 @@ class Nodes(object):
"""Class nodes """ """Class nodes """
def __init__(self, cluster, extended, conf, destdir, filename=None): def __init__(self, cluster, extended, conf, destdir, filename=None):
import_subprocess()
self.dirname = conf.rqdir.rstrip('/') self.dirname = conf.rqdir.rstrip('/')
if (not os.path.exists(self.dirname)): if (not os.path.exists(self.dirname)):
logging.error("directory %s doesn't exist" % (self.dirname)) logging.error("directory %s doesn't exist" % (self.dirname))
@ -515,6 +515,7 @@ class Nodes(object):
llf.write(line+"\0") llf.write(line+"\0")
except: except:
logging.error("create_archive_logs: Can't write to file %s" % logslistfile) logging.error("create_archive_logs: Can't write to file %s" % logslistfile)
continue
cmd = "tar --bzip2 --create --file - --null --files-from -" cmd = "tar --bzip2 --create --file - --null --files-from -"
t = threading.Thread(target=node.exec_simple_cmd, t = threading.Thread(target=node.exec_simple_cmd,
args=(cmd, args=(cmd,

View File

@ -22,7 +22,6 @@ import sys
import os import os
from conf import Conf from conf import Conf
import flock import flock
from tools import import_subprocess
def main(argv=None): def main(argv=None):
@ -60,7 +59,6 @@ def main(argv=None):
loglevel = logging.INFO loglevel = logging.INFO
logging.basicConfig(level=loglevel, logging.basicConfig(level=loglevel,
format='%(asctime)s %(levelname)s %(message)s') format='%(asctime)s %(levelname)s %(message)s')
import_subprocess()
config = Conf.load_conf(args.config) config = Conf.load_conf(args.config)
main_arc = os.path.join(config.archives, 'general.tar.bz2') main_arc = os.path.join(config.archives, 'general.tar.bz2')
if args.dest_file: if args.dest_file: