Revision e5b4db06 snf-deploy/fabfile.py

b/snf-deploy/fabfile.py
16 16

  
17 17

  
18 18
def setup_env(confdir="conf", packages="packages",
19
              templates="files", cluster_name="ganeti1", autoconf=False, disable_colors=False):
19
              templates="files", cluster_name="ganeti1", autoconf=False, disable_colors=False, key_inject=False):
20 20
    print("Loading configuration for synnefo...")
21 21
    print(" * Using config files under %s..." % confdir)
22 22
    print(" * Using %s and %s for packages and templates accordingly..." % (packages, templates))
23 23

  
24 24
    autoconf = ast.literal_eval(autoconf)
25 25
    disable_colors = ast.literal_eval(disable_colors)
26
    env.key_inject = ast.literal_eval(key_inject)
26 27
    conf = Conf.configure(confdir=confdir, cluster_name=cluster_name, autoconf=autoconf)
27 28
    env.env = Env(conf)
28 29

  
......
226 227

  
227 228
@roles("ips")
228 229
def add_keys():
229
    if not ast.literal_eval(env.env.key_inject):
230
    if not env.key_inject:
230 231
      debug(env.host, "Skipping ssh keys injection..")
232
      return
233
    else:
234
      debug(env.host, "Adding rsa/dsa keys..")
231 235
    try_run("mkdir -p /root/.ssh")
232 236
    cmd = """
233 237
for f in $(ls /root/.ssh/*); do

Also available in: Unified diff