Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Łukasz Nowak
slapos
Commits
a57f9d57
Commit
a57f9d57
authored
Jul 05, 2012
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update to latest agent.
Fewer parameters, one more dependency.
parent
6026a297
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
37 deletions
+8
-37
slapos/recipe/agent/__init__.py
slapos/recipe/agent/__init__.py
+4
-32
software/agent/instance.cfg
software/agent/instance.cfg
+1
-3
software/agent/software.cfg
software/agent/software.cfg
+3
-2
No files found.
slapos/recipe/agent/__init__.py
View file @
a57f9d57
...
...
@@ -53,46 +53,18 @@ class Recipe(BaseSlapRecipe, GenericSlapRecipe):
configuration_path
=
os
.
path
.
join
(
self
.
work_directory
,
"agent.cfg"
)
with
open
(
configuration_path
,
"w"
)
as
configuration
:
configuration
.
write
(
parameter_dict
[
"configuration"
])
if
"key"
in
parameter_dict
:
key_filepath
=
os
.
path
.
join
(
self
.
work_directory
,
"key"
)
cert_filepath
=
os
.
path
.
join
(
self
.
work_directory
,
"cert"
)
with
open
(
key_filepath
,
"w"
)
as
key_file
:
key_file
.
write
(
parameter_dict
[
'key'
])
with
open
(
cert_filepath
,
"w"
)
as
cert_file
:
cert_file
.
write
(
parameter_dict
[
"cert"
])
extra_arguments
=
"--key_file=%s --cert_file=%s "
%
(
key_filepath
,
cert_filepath
)
else
:
extra_arguments
=
""
state_file
=
self
.
options
[
"state_file"
]
open
(
state_file
,
"a"
).
close
()
agent_crond_path
=
os
.
path
.
join
(
crond
,
"agent"
)
with
open
(
agent_crond_path
,
"w"
)
as
agent_crond
:
agent_crond
.
write
(
"*/5 * * * * %s -S %s --pidfile=%s --log
_directory
=%s "
"
--state_file=%s --path_file=%s %s%s
\
n
"
%
(
agent_crond
.
write
(
"*/5 * * * * %s -S %s --pidfile=%s --log=%s "
"
%s 2>&1 > /dev/null
\
n
"
%
(
self
.
options
[
"python_binary"
],
self
.
options
[
"agent_binary"
],
self
.
options
[
"pidfile"
],
self
.
options
[
"log_directory"
],
state_file
,
self
.
options
[
"path_file"
],
extra_arguments
,
self
.
options
[
"log"
],
configuration_path
,
))
agent_crond
.
write
(
"1 0 * * * %s -S %s %s
\
n
"
%
(
self
.
options
[
"python_binary"
],
self
.
options
[
"report_start"
],
configuration_path
))
agent_crond
.
write
(
"59 23 * * * %s -S %s %s
\
n
"
%
(
self
.
options
[
"python_binary"
],
self
.
options
[
"report_stop"
],
configuration_path
,
))
return
self
.
path_list
+
[
configuration_path
,
key_filepath
,
cert_filepath
,
agent_crond_path
]
return
self
.
path_list
+
[
configuration_path
,
agent_crond_path
]
def
installCrond
(
self
):
_
,
ws
=
self
.
egg
.
working_set
()
...
...
software/agent/instance.cfg
View file @
a57f9d57
...
...
@@ -13,9 +13,7 @@ report_stop = ${buildout:directory}/bin/report_stop
dcrond_binary = ${dcron:location}/sbin/crond
python_binary = ${python2.7:location}/bin/python
pidfile = $${rootdirectory:run}/agent.pid
log_directory = $${rootdirectory:agentlog}
state_file = $${rootdirectory:srv}/state.cfg
path_file = $${rootdirectory:srv}/path.cfg
log = $${rootdirectory:agentlog}/agent.log
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
...
...
software/agent/software.cfg
View file @
a57f9d57
...
...
@@ -26,7 +26,7 @@ eggs = ${instance-recipe:egg}
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/template.cfg
md5sum =
03243998bea8c2a4a8d20c150dfe1469
md5sum =
c7cb98594f394d05baedabe424643f6f
mode = 0644
[eggs]
...
...
@@ -36,6 +36,7 @@ eggs =
${lxml-python:egg}
slapos.cookbook
slapos.toolbox
erp5.util
[lxml-python]
python = python2.7
...
...
@@ -48,7 +49,7 @@ eggs =
${lxml-python:egg}
slapos.core
slapos.cookbook
slapos.toolbox
slapos.toolbox
[agent]
[networkcache]
# signature certificates of the following uploaders.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment