Commit 2dfd4830 authored by Alain Takoudjou's avatar Alain Takoudjou

BonjourGrid: Resolv hostname bug when deploy condor project

parent fe47fae3
...@@ -50,12 +50,9 @@ class Recipe(GenericBaseRecipe): ...@@ -50,12 +50,9 @@ class Recipe(GenericBaseRecipe):
type = self.options['type'].strip() type = self.options['type'].strip()
if type == "condor": if type == "condor":
startCondor = True startCondor = True
hostname = self.options['condor_host'].strip() project = self.options['condor_host'].strip()
url = "http://%s" % hostname
if type == "boinc": if type == "boinc":
import socket project = self.options['url-boinc'].strip()
hostname = socket.gethostname()
url = self.options['url-boinc'].strip()
startBoinc = True startBoinc = True
#Generate BOINC/Condor launcher script #Generate BOINC/Condor launcher script
...@@ -82,7 +79,6 @@ class Recipe(GenericBaseRecipe): ...@@ -82,7 +79,6 @@ class Recipe(GenericBaseRecipe):
'--pid_file', pid_file, '--pid_file', pid_file,
'--master_wrapper', grid_wrapper, '--master_wrapper', grid_wrapper,
'--directory', self.options['work_dir'].strip(), '--directory', self.options['work_dir'].strip(),
'--install_directory', self.options['install_dir'].strip(),
'--server', self.options['redis-url'].strip(), '--server', self.options['redis-url'].strip(),
'--port', self.options['redis-port'].strip(), '--port', self.options['redis-port'].strip(),
'--num_workers', self.options['nworkers'].strip(), '--num_workers', self.options['nworkers'].strip(),
...@@ -97,7 +93,7 @@ class Recipe(GenericBaseRecipe): ...@@ -97,7 +93,7 @@ class Recipe(GenericBaseRecipe):
config_info = self.createFile(config_info_file, config_info = self.createFile(config_info_file,
self.substituteTemplate(self.getTemplateFilename('machineinfo.sh.in'), self.substituteTemplate(self.getTemplateFilename('machineinfo.sh.in'),
dict(ip_address=self.options['ipv6'].strip(), dict(ip_address=self.options['ipv6'].strip(),
hostname=hostname, url=url, project=project,
middleware=type))) middleware=type)))
os.chmod(config_info_file, 0744) os.chmod(config_info_file, 0744)
path_list.append(config_info) path_list.append(config_info)
......
...@@ -4,15 +4,15 @@ Mhz=`grep -i Mhz /proc/cpuinfo | cut -d : -f2 | head -1 | cut -f2 -d " "` ...@@ -4,15 +4,15 @@ Mhz=`grep -i Mhz /proc/cpuinfo | cut -d : -f2 | head -1 | cut -f2 -d " "`
mem=`grep -i MemTotal /proc/meminfo | cut -f2 -d :` mem=`grep -i MemTotal /proc/meminfo | cut -f2 -d :`
Ram=`echo $mem | cut -f1 -d " "` Ram=`echo $mem | cut -f1 -d " "`
Cpu=`uname -a | cut -f3 -d " "` Cpu=`uname -a | cut -f3 -d " "`
H=%(hostname)s H=`hostname`
Nbproc=`grep processor /proc/cpuinfo |wc -l` Nbproc=`grep processor /proc/cpuinfo |wc -l`
Ip=%(ip_address)s Ip=%(ip_address)s
status="in execution" status="in execution"
secours="host1" secours="host1"
middleware="%(middleware)s" middleware="%(middleware)s"
url="%(url)s" project="%(project)s"
c="{'"MHZ"':\"$Mhz\",'"Ram"':\"$Ram\",'"Cpu"':\"$Cpu\",'"HOST"':\"$H\",'"IP"':\"$Ip\",'"STATUS"':\"$status\",'"SECOURS"':\"$secours\",'"MIDDLEWARE"':\"$middleware\",'"URL"':\"$url\",}" c="{'"MHZ"':\"$Mhz\",'"Ram"':\"$Ram\",'"Cpu"':\"$Cpu\",'"HOST"':\"$H\",'"IP"':\"$Ip\",'"STATUS"':\"$status\",'"SECOURS"':\"$secours\",'"MIDDLEWARE"':\"$middleware\",'"PROJECT"':\"$project\",}"
filename=`hostname` filename=`hostname`
echo $c > $filename echo $c > $filename
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