if src.product.product_is_cpp(mm):
# cpp module
for aa in src.product.get_product_components(mm):
- install_dir = os.path.join(config.APPLICATION.workdir,
- "INSTALL")
+ install_dir=os.path.join(config.APPLICATION.workdir,
+ config.INTERNAL.config.install_dir)
mp = os.path.join(install_dir, aa)
flagline = add_module_to_appli(f,
aa,
catalog = file(catfile, "w")
catalog.write("<!DOCTYPE ResourcesCatalog>\n<resources>\n")
for k in machines:
- logger.write(" ssh %s " % (k + " ").ljust(20, '.'), 4)
- logger.flush()
-
- 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:
- logger.write(src.printcolors.printc(src.KO_STATUS) + "\n", 4)
- logger.write(" " + src.printcolors.printcWarning(p.stderr.read()),
- 2)
- else:
- 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
+ if not src.architecture.is_windows():
+ logger.write(" ssh %s " % (k + " ").ljust(20, '.'), 4)
+ logger.flush()
+
+ 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()
+
+ machine_access = (p.returncode == 0)
+ if not machine_access:
+ logger.write(src.printcolors.printc(src.KO_STATUS) + "\n", 4)
+ logger.write(" " + src.printcolors.printcWarning(p.stderr.read()),
+ 2)
+ else:
+ 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(" <machine\n")
catalog.write(" protocol=\"ssh\"\n")
catalog.write(" nbOfNodes=\"1\"\n")
catalog.write(" mode=\"interactif\"\n")
catalog.write(" OS=\"LINUX\"\n")
- catalog.write(" CPUFreqMHz=\"%s\"\n" % freq)
- catalog.write(" nbOfProcPerNode=\"%s\"\n" % nb_proc)
- catalog.write(" memInMB=\"%s\"\n" % memory)
+
+ if (not src.architecture.is_windows()) and machine_access:
+ catalog.write(" CPUFreqMHz=\"%s\"\n" % freq)
+ catalog.write(" nbOfProcPerNode=\"%s\"\n" % nb_proc)
+ catalog.write(" memInMB=\"%s\"\n" % memory)
+
catalog.write(" userName=\"%s\"\n" % user)
catalog.write(" name=\"%s\"\n" % k)
catalog.write(" hostname=\"%s\"\n" % k)
# if section APPLICATION.virtual_app does not exists create one
if "virtual_app" not in runner.cfg.APPLICATION:
- msg = _("The section APPLICATION.virtual_app is not defined in the product.")
+ msg = _("The section APPLICATION.virtual_app is not defined in the product. Use sat launcher in state")
logger.write(src.printcolors.printcError(msg), 1)
logger.write("\n", 1)
return 1