accords : Add testos debug utility

parent a1240c08
...@@ -35,15 +35,29 @@ class Recipe(GenericSlapRecipe): ...@@ -35,15 +35,29 @@ class Recipe(GenericSlapRecipe):
path_list = [] path_list = []
poc_location = self.buildout['pocdirectory']['poc'] poc_location = self.buildout['pocdirectory']['poc']
# Generate os-config.xml parameter_dict = dict(
os_configuration_parameter_dict = dict(
userid=self.options['userid'], userid=self.options['userid'],
password=self.options['password'], password=self.options['password'],
domain=self.options['domain'], domain=self.options['domain'],
openstack_url=self.options['openstack_url'],
python_location=sys.executable,
poc_location=poc_location,
manifest_name=self.options['manifest-name'],
# XXX this is workaround
accords_lib_directory=self.options['accords_lib_directory'],
computer_id = self.computer_id,
computer_partition_id = self.computer_partition_id,
server_url = self.server_url,
software_release_url = self.software_release_url,
key_file = self.key_file,
cert_file = self.cert_file,
path = '%s:%s' % (self.options['accords_bin_directory'],
os.environ.get('PATH', '')),
) )
# Generate os-config.xml
os_config_file = self.createFile(self.options['os-config'], os_config_file = self.createFile(self.options['os-config'],
self.substituteTemplate(self.getTemplateFilename('os_config.xml.in'), self.substituteTemplate(self.getTemplateFilename('os_config.xml.in'),
os_configuration_parameter_dict)) parameter_dict))
path_list.append(os_config_file) path_list.append(os_config_file)
# Put modified accords configuration file # Put modified accords configuration file
...@@ -69,24 +83,16 @@ class Recipe(GenericSlapRecipe): ...@@ -69,24 +83,16 @@ class Recipe(GenericSlapRecipe):
path_list.append(manifest_location) path_list.append(manifest_location)
# Generate wrapper # Generate wrapper
wrapper_config_dict = dict(
python_location=sys.executable,
poc_location=poc_location,
manifest_name=self.options['manifest-name'],
# XXX this is workaround
accords_lib_directory=self.options['accords_lib_directory'],
computer_id = self.computer_id,
computer_partition_id = self.computer_partition_id,
server_url = self.server_url,
software_release_url = self.software_release_url,
key_file = self.key_file,
cert_file = self.cert_file,
path = '%s:%s' % (self.options['accords_bin_directory'],
os.environ.get('PATH', '')),
)
wrapper_location = self.createPythonScript(self.options['accords-wrapper'], wrapper_location = self.createPythonScript(self.options['accords-wrapper'],
'%s.accords.runAccords' % __name__, '%s.accords.runAccords' % __name__,
wrapper_config_dict) parameter_dict)
path_list.append(wrapper_location) path_list.append(wrapper_location)
# Generate helper for debug
self.createExecutable(
self.options['testos-wrapper'],
self.substituteTemplate(self.getTemplateFilename('testos.in'),
parameter_dict)
)
return path_list return path_list
<os_configs> <os_configs>
<os_config <os_config
id="e1f892e3-slap-slap-slap-9354b95d3b17" id="e1f892e3-slap-slap-slap-9354b95d3b17"
name="slaposrecipe" name="slaposrecipe"
description="Configuration of Account used by slapos recipe" description="Configuration of Account used by slapos recipe"
user="%(userid)s" user="%(userid)s"
password="%(password)s" password="%(password)s"
authenticate="" authenticate=""
agent="CompatibleOne/OpenStackClient/1.0a.0.01" agent="CompatibleOne/OpenStackClient/1.0a.0.01"
host="http://beta.enocloud.com:5000/v2.0/" host="%(openstack_url)s"
version="v1.1" version="v1.1"
namespace="%(domain)s" namespace="%(domain)s"
base="" base=""
......
#!/bin/sh
export PATH=%(path)s
export ENO_HOST=%(openstack_url)s
export ENO_USER=%(userid)s
export ENO_PASS=%(password)s
export ENO_VERSION=v1.1
testos --host $ENO_HOST --password $ENO_PASS --user $ENO_USER --version $ENO_VERSION $1 $2 $3 $4 $5 $6 $7
...@@ -9,7 +9,7 @@ offline = true ...@@ -9,7 +9,7 @@ offline = true
#[url] #[url]
#recipe = slapos.cookbook:publishurl #recipe = slapos.cookbook:publishurl
#url = #url =
[accords-instance] [accords-instance]
recipe = slapos.cookbook:accords recipe = slapos.cookbook:accords
...@@ -21,6 +21,7 @@ domain = domain ...@@ -21,6 +21,7 @@ domain = domain
#userid = $${slap-parameter:userid} #userid = $${slap-parameter:userid}
#password = $${slap-parameter:password} #password = $${slap-parameter:password}
#domain = $${slap-parameter:domain} #domain = $${slap-parameter:domain}
openstack_url = http://beta.enocloud.com:5000/v2.0/
os-config = $${pocdirectory:poc}/os_config.xml os-config = $${pocdirectory:poc}/os_config.xml
listen-ip = $${slap-network-information:local-ipv4} listen-ip = $${slap-network-information:local-ipv4}
...@@ -30,6 +31,7 @@ manifest-source = ${accords-manifest:target} ...@@ -30,6 +31,7 @@ manifest-source = ${accords-manifest:target}
manifest-destination = $${pocdirectory:poc}/manifest.xml manifest-destination = $${pocdirectory:poc}/manifest.xml
manifest-name = manifest manifest-name = manifest
accords-wrapper = $${basedirectory:services}/accords accords-wrapper = $${basedirectory:services}/accords
testos-wrapper = $${rootdirectory:bin}/testos
# Workaround # Workaround
accords_lib_directory : ${accords:location}/lib accords_lib_directory : ${accords:location}/lib
accords_bin_directory : ${accords:location}/bin accords_bin_directory : ${accords:location}/bin
...@@ -71,18 +73,18 @@ file-list = ...@@ -71,18 +73,18 @@ file-list =
${accords-scripts:location}/scripts/co-stop ${accords-scripts:location}/scripts/co-stop
${accords-scripts:location}/scripts/run-azprocci ${accords-scripts:location}/scripts/run-azprocci
${accords-scripts:location}/scripts/run-broker ${accords-scripts:location}/scripts/run-broker
${accords-scripts:location}/scripts/run-coees ${accords-scripts:location}/scripts/run-coees
${accords-scripts:location}/scripts/run-coes ${accords-scripts:location}/scripts/run-coes
${accords-scripts:location}/scripts/run-coips ${accords-scripts:location}/scripts/run-coips
${accords-scripts:location}/scripts/run-comons ${accords-scripts:location}/scripts/run-comons
${accords-scripts:location}/scripts/run-conets ${accords-scripts:location}/scripts/run-conets
${accords-scripts:location}/scripts/run-coobas ${accords-scripts:location}/scripts/run-coobas
${accords-scripts:location}/scripts/run-cosacs ${accords-scripts:location}/scripts/run-cosacs
${accords-scripts:location}/scripts/run-coss ${accords-scripts:location}/scripts/run-coss
${accords-scripts:location}/scripts/run-ezvm ${accords-scripts:location}/scripts/run-ezvm
${accords-scripts:location}/scripts/run-fileserver ${accords-scripts:location}/scripts/run-fileserver
${accords-scripts:location}/scripts/run-onprocci ${accords-scripts:location}/scripts/run-onprocci
${accords-scripts:location}/scripts/run-osprocci ${accords-scripts:location}/scripts/run-osprocci
${accords-scripts:location}/scripts/run-parser ${accords-scripts:location}/scripts/run-parser
${accords-scripts:location}/scripts/run-procci ${accords-scripts:location}/scripts/run-procci
${accords-scripts:location}/scripts/run-publisher ${accords-scripts:location}/scripts/run-publisher
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