X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=commands%2Flauncher.py;h=0955d9544683c52d5afb8d304f3181d7ae3ccbfc;hb=458ca3d65199bf618d286a5d252916eb186ff031;hp=b7d9feda58f842594575ce4611c873f35d374c99;hpb=8e570ea16f8562516407d5c8fc0268a600079b76;p=tools%2Fsat.git diff --git a/commands/launcher.py b/commands/launcher.py index b7d9fed..0955d95 100644 --- a/commands/launcher.py +++ b/commands/launcher.py @@ -104,13 +104,17 @@ def generate_launch_file(config, else: app_root_dir=salome_application_name - # Get the launcher template - withProfile = src.fileEnviron.withProfile\ - .replace("BIN_KERNEL_INSTALL_DIR", bin_kernel_install_dir)\ - .replace("KERNEL_INSTALL_DIR", app_root_dir) + # Get the launcher template (python3 or python2) + if "python3" in config.APPLICATION and config.APPLICATION.python3 == "yes": + withProfile = src.fileEnviron.withProfile3\ + .replace("BIN_KERNEL_INSTALL_DIR", bin_kernel_install_dir)\ + .replace("KERNEL_INSTALL_DIR", app_root_dir) + else: + withProfile = src.fileEnviron.withProfile\ + .replace("BIN_KERNEL_INSTALL_DIR", bin_kernel_install_dir)\ + .replace("KERNEL_INSTALL_DIR", app_root_dir) - before, after = withProfile.split( - "# here your local standalone environment\n") + before, after = withProfile.split("# here your local standalone environment\n") # create an environment file writer writer = src.environment.FileEnvWriter(config, @@ -175,44 +179,49 @@ def generate_catalog(machines, config, logger): # Write into it catalog.write("\n\n") for k in machines: - logger.write(" ssh %s " % (k + " ").ljust(20, '.'), 4) - logger.flush() - - # Verify that the machine is accessible - ssh_cmd = 'ssh -o "StrictHostKeyChecking no" %s %s' % (k, cmd) - p = subprocess.Popen(ssh_cmd, shell=True, - stdin=subprocess.PIPE, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - p.wait() - - if p.returncode != 0: # The machine is not accessible - logger.write(src.printcolors.printc(src.KO_STATUS) + "\n", 4) - logger.write(" " + - src.printcolors.printcWarning(p.stderr.read()), 2) - else: - # The machine is accessible, write the corresponding section on - # the xml file - logger.write(src.printcolors.printc(src.OK_STATUS) + "\n", 4) - lines = p.stdout.readlines() - freq = lines[0][:-1].split(':')[-1].split('.')[0].strip() - nb_proc = len(lines) -1 - memory = lines[-1].split(':')[-1].split()[0].strip() - memory = int(memory) / 1000 - - catalog.write(" \n") - catalog.write(" \n") + + catalog.write(" userName=\"%s\"\n" % user) + catalog.write(" name=\"%s\"\n" % k) + catalog.write(" hostname=\"%s\"\n" % k) + catalog.write(" >\n") + catalog.write(" \n") catalog.write("\n") catalog.close()