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):
type = self.options['type'].strip()
if type == "condor":
startCondor = True
hostname = self.options['condor_host'].strip()
url = "http://%s" % hostname
project = self.options['condor_host'].strip()
if type == "boinc":
import socket
hostname = socket.gethostname()
url = self.options['url-boinc'].strip()
project = self.options['url-boinc'].strip()
startBoinc = True
#Generate BOINC/Condor launcher script
......@@ -82,7 +79,6 @@ class Recipe(GenericBaseRecipe):
'--pid_file', pid_file,
'--master_wrapper', grid_wrapper,
'--directory', self.options['work_dir'].strip(),
'--install_directory', self.options['install_dir'].strip(),
'--server', self.options['redis-url'].strip(),
'--port', self.options['redis-port'].strip(),
'--num_workers', self.options['nworkers'].strip(),
......@@ -97,11 +93,11 @@ class Recipe(GenericBaseRecipe):
config_info = self.createFile(config_info_file,
self.substituteTemplate(self.getTemplateFilename('machineinfo.sh.in'),
dict(ip_address=self.options['ipv6'].strip(),
hostname=hostname, url=url,
project=project,
middleware=type)))
os.chmod(config_info_file, 0744)
path_list.append(config_info)
update = install
class Client(GenericBaseRecipe):
......
......@@ -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 :`
Ram=`echo $mem | cut -f1 -d " "`
Cpu=`uname -a | cut -f3 -d " "`
H=%(hostname)s
H=`hostname`
Nbproc=`grep processor /proc/cpuinfo |wc -l`
Ip=%(ip_address)s
status="in execution"
secours="host1"
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`
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