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
Labels
Merge Requests
107
Merge Requests
107
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
7f64359e
Commit
7f64359e
authored
Jun 01, 2012
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use "with" keyword to open & close file.
parent
5db300f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
18 deletions
+17
-18
slapos/recipe/agent/__init__.py
slapos/recipe/agent/__init__.py
+17
-18
No files found.
slapos/recipe/agent/__init__.py
View file @
7f64359e
...
...
@@ -84,24 +84,23 @@ class Recipe(BaseSlapRecipe, GenericSlapRecipe):
configuration
.
write
(
open
(
configuration_path
,
"w"
))
agent_crond_path
=
os
.
path
.
join
(
crond
,
"agent"
)
agent_crond
=
open
(
agent_crond_path
,
"w"
)
agent_crond
.
write
(
"*/5 * * * * %s -S %s --pidfile=%s %s
\
n
"
%
(
self
.
options
[
"python_binary"
],
self
.
options
[
"agent_binary"
],
self
.
options
[
"pidfile"
],
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
,
))
agent_crond
.
close
()
with
open
(
agent_crond_path
,
"w"
)
as
agent_crond
:
agent_crond
.
write
(
"*/5 * * * * %s -S %s --pidfile=%s %s
\
n
"
%
(
self
.
options
[
"python_binary"
],
self
.
options
[
"agent_binary"
],
self
.
options
[
"pidfile"
],
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
]
...
...
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