Commit dfdb8ad3 authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis Committed by Christos Stavrakakis
Browse files

Pass key_inject in setup_env

Signed-off-by: default avatarDimitris Aragiorgis <>
parent e84191ec
......@@ -16,13 +16,14 @@ from snfdeploy import massedit
def setup_env(confdir="conf", packages="packages",
templates="files", cluster_name="ganeti1", autoconf=False, disable_colors=False):
templates="files", cluster_name="ganeti1", autoconf=False, disable_colors=False, key_inject=False):
print("Loading configuration for synnefo...")
print(" * Using config files under %s..." % confdir)
print(" * Using %s and %s for packages and templates accordingly..." % (packages, templates))
autoconf = ast.literal_eval(autoconf)
disable_colors = ast.literal_eval(disable_colors)
env.key_inject = ast.literal_eval(key_inject)
conf = Conf.configure(confdir=confdir, cluster_name=cluster_name, autoconf=autoconf)
env.env = Env(conf)
......@@ -226,8 +227,11 @@ def check_ssh():
def add_keys():
if not ast.literal_eval(env.env.key_inject):
if not env.key_inject:
debug(, "Skipping ssh keys injection..")
debug(, "Adding rsa/dsa keys..")
try_run("mkdir -p /root/.ssh")
cmd = """
for f in $(ls /root/.ssh/*); do
......@@ -255,9 +255,9 @@ def fabcommand(args, env, actions, nodes=[]):
fabcmd += " --fabfile {4}/ \
autoconf={5},disable_colors={6} \
autoconf={5},disable_colors={6},key_inject={7} \
".format(args.confdir, env.packages, env.templates, args.cluster_name,
env.lib, args.autoconf, args.disable_colors)
env.lib, args.autoconf, args.disable_colors, args.key_inject)
if nodes:
hosts = [env.nodes_info[n].hostname for n in nodes]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment