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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kwabena Antwi-Boasiako
slapos
Commits
f2fcfd91
Commit
f2fcfd91
authored
Nov 29, 2012
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify slapreport recipe with createWrapper
parent
4de4494d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
32 deletions
+14
-32
slapos/recipe/slapreport/__init__.py
slapos/recipe/slapreport/__init__.py
+14
-27
slapos/recipe/slapreport/template/slapreport_run.in
slapos/recipe/slapreport/template/slapreport_run.in
+0
-5
No files found.
slapos/recipe/slapreport/__init__.py
View file @
f2fcfd91
...
...
@@ -24,36 +24,23 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from
slapos.recipe.librecipe
import
GenericBaseRecipe
class
Recipe
(
GenericBaseRecipe
):
"""
Slapmonitor instance configuration.
"""
def
__init__
(
self
,
buildout
,
name
,
options
):
return
GenericBaseRecipe
.
__init__
(
self
,
buildout
,
name
,
options
)
def
install
(
self
):
config
=
dict
(
pid_file_path
=
self
.
options
[
'pid-file'
],
consumption_log_path
=
self
.
options
[
'consumption-log-path'
],
database_path
=
self
.
options
[
'database-path'
],
slapreport_path
=
self
.
options
[
'slapreport-path'
],
logbox_ip
=
self
.
options
[
'logbox-ip'
],
logbox_port
=
self
.
options
[
'logbox-port'
],
logbox_user
=
self
.
options
[
'logbox-user'
],
logbox_passwd
=
self
.
options
[
'logbox-passwd'
],
shell_path
=
self
.
options
[
'shell-path'
],
)
# Runners
runner_path
=
self
.
createExecutable
(
self
.
options
[
'path'
],
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'slapreport_run.in'
),
config
))
return
[
runner_path
]
options
=
self
.
options
script
=
self
.
createWrapper
(
name
=
options
[
'path'
],
command
=
options
[
'slapreport-path'
],
parameters
=
[
options
[
'pid-file'
],
options
[
'consumption-log-path'
],
options
[
'database-path'
],
options
[
'logbox-ip'
],
options
[
'logbox-port'
],
options
[
'logbox-user'
],
options
[
'logbox-passwd'
],
])
return
[
script
]
def
update
(
self
):
pass
slapos/recipe/slapreport/template/slapreport_run.in
deleted
100644 → 0
View file @
4de4494d
#!%(shell_path)s
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
#
exec %(slapreport_path)s %(pid_file_path)s %(consumption_log_path)s %(database_path)s %(logbox_ip)s %(logbox_port)s %(logbox_user)s %(logbox_passwd)s
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