Commit 7764e58a authored by Yingjie Xu's avatar Yingjie Xu

Add report url.

parent 99a3f950
...@@ -55,6 +55,7 @@ class Recipe(BaseSlapRecipe, GenericSlapRecipe): ...@@ -55,6 +55,7 @@ class Recipe(BaseSlapRecipe, GenericSlapRecipe):
configuration.add_section("agent") configuration.add_section("agent")
configuration.set("agent", "portal_url", self.parameter_dict["portal_url"]) configuration.set("agent", "portal_url", self.parameter_dict["portal_url"])
configuration.set("agent", "master_url", self.parameter_dict["master_url"]) configuration.set("agent", "master_url", self.parameter_dict["master_url"])
configuration.set("agent", "report_url", self.parameter_dict["report_url"])
key_filepath = os.path.join(self.work_directory, "key") key_filepath = os.path.join(self.work_directory, "key")
key_file = open(key_filepath, "w") key_file = open(key_filepath, "w")
key_file.write(self.parameter_dict["key"]) key_file.write(self.parameter_dict["key"])
...@@ -78,11 +79,11 @@ class Recipe(BaseSlapRecipe, GenericSlapRecipe): ...@@ -78,11 +79,11 @@ class Recipe(BaseSlapRecipe, GenericSlapRecipe):
state = open(self.options["state_file"], "w") state = open(self.options["state_file"], "w")
state.write('') state.write('')
state.close() state.close()
configuration.set("agent", "path_file", self.options["path_file"])
configuration.add_section("software_uri") configuration.add_section("software_uri")
software_list = json.loads(self.parameter_dict["software_list"]) software_list = json.loads(self.parameter_dict["software_list"])
for software in software_list: for software in software_list:
configuration.set("software_uri", software, self.parameter_dict[software]) configuration.set("software_uri", software, self.parameter_dict[software])
configuration.write(open(configuration_path, "w")) configuration.write(open(configuration_path, "w"))
agent_crond_path = os.path.join(self.crond, "agent") agent_crond_path = os.path.join(self.crond, "agent")
......
...@@ -9,17 +9,20 @@ develop-eggs-directory = ${buildout:develop-eggs-directory} ...@@ -9,17 +9,20 @@ develop-eggs-directory = ${buildout:develop-eggs-directory}
[instance] [instance]
recipe = ${instance-recipe:egg}:${instance-recipe:module} recipe = ${instance-recipe:egg}:${instance-recipe:module}
agent_binary = ${buildout:directory}/bin/agent agent_binary = ${buildout:directory}/bin/agent
report_start = ${buildout:directory}/bin/report_start
report_stop = ${buildout:directory}/bin/report_stop
dcrond_binary = ${dcron:location}/sbin/crond dcrond_binary = ${dcron:location}/sbin/crond
python_binary = ${python2.7:location}/bin/python python_binary = ${python2.7:location}/bin/python
pidfile = $${buildout:directory}/agent.pid pidfile = $${rootdirectory:run}/agent.pid
log_directory = $${buildout:directory}/var/log log_directory = $${rootdirectory:agentlog}
state_file = $${buildout:directory}/state.cfg state_file = $${rootdirectory:srv}/state.cfg
[rootdirectory] [rootdirectory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc/ etc = $${buildout:directory}/etc
run = $${rootdirectory:etc}/run/ run = $${rootdirectory:etc}/run
var = $${buildout:directory}/var/ var = $${buildout:directory}/var
log = $${rootdirectory:var}/log/ log = $${rootdirectory:var}/log
srv = $${buildout:directory}/srv/ agentlog = $${rootdirectory:log}/agent
bin = $${buildout:directory}/bin/ srv = $${buildout:directory}/srv
bin = $${buildout:directory}/bin
[buildout] [buildout]
# develop = develop =
# /opt/slapdev /opt/slapdev
# /opt/slapos.toolbox /opt/slapos.toolbox
extends = extends =
../../component/dcron/buildout.cfg ../../component/dcron/buildout.cfg
...@@ -31,7 +31,7 @@ eggs = ${instance-recipe:egg} ...@@ -31,7 +31,7 @@ eggs = ${instance-recipe:egg}
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/template.cfg output = ${buildout:directory}/template.cfg
md5sum = 2e1a7a68b18de68b163e98a5f92cc776 md5sum = 10d7cf082399948e8dfef1c4644b4425
mode = 0644 mode = 0644
[eggs] [eggs]
......
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