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
Sebastian
slapos
Commits
b817a95a
Commit
b817a95a
authored
Apr 03, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Write docstring for librecipes class, issue deprecation warning for oldest one.
parent
9e3efcc1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
slapos/recipe/librecipe/__init__.py
slapos/recipe/librecipe/__init__.py
+2
-0
slapos/recipe/librecipe/generic.py
slapos/recipe/librecipe/generic.py
+2
-3
slapos/recipe/librecipe/genericslap.py
slapos/recipe/librecipe/genericslap.py
+4
-1
No files found.
slapos/recipe/librecipe/__init__.py
View file @
b817a95a
...
@@ -236,6 +236,8 @@ class BaseSlapRecipe:
...
@@ -236,6 +236,8 @@ class BaseSlapRecipe:
return
'insecure'
return
'insecure'
def
install
(
self
):
def
install
(
self
):
self
.
logger
.
warning
(
"BaseSlapRecipe has been deprecated. Use "
\
"GenericBaseRecipe or GenericSlapRecipe instead."
)
self
.
slap
.
initializeConnection
(
self
.
server_url
,
self
.
key_file
,
self
.
slap
.
initializeConnection
(
self
.
server_url
,
self
.
key_file
,
self
.
cert_file
)
self
.
cert_file
)
self
.
computer_partition
=
self
.
slap
.
registerComputerPartition
(
self
.
computer_partition
=
self
.
slap
.
registerComputerPartition
(
...
...
slapos/recipe/librecipe/generic.py
View file @
b817a95a
...
@@ -36,6 +36,8 @@ import pkg_resources
...
@@ -36,6 +36,8 @@ import pkg_resources
import
zc.buildout
import
zc.buildout
class
GenericBaseRecipe
(
object
):
class
GenericBaseRecipe
(
object
):
"""Boilerplate class providing helpful methods for all SlapOS recipes.
Can be used to extend SlapOS recipes to ease development"""
TRUE_VALUES
=
[
'y'
,
'yes'
,
'1'
,
'true'
]
TRUE_VALUES
=
[
'y'
,
'yes'
,
'1'
,
'true'
]
FALSE_VALUES
=
[
'n'
,
'no'
,
'0'
,
'false'
]
FALSE_VALUES
=
[
'n'
,
'no'
,
'0'
,
'false'
]
...
@@ -145,9 +147,6 @@ class GenericBaseRecipe(object):
...
@@ -145,9 +147,6 @@ class GenericBaseRecipe(object):
* if the host is an ipv6 address, brackets will be added to surround it.
* if the host is an ipv6 address, brackets will be added to surround it.
"""
"""
# XXX-Antoine: I didn't find any standard module to join an url with
# login, password, ipv6 host and port.
# So instead of copy and past in every recipe I factorized it right here.
netloc
=
''
netloc
=
''
if
auth
is
not
None
:
if
auth
is
not
None
:
auth
=
tuple
(
auth
)
auth
=
tuple
(
auth
)
...
...
slapos/recipe/librecipe/genericslap.py
View file @
b817a95a
...
@@ -30,7 +30,10 @@ import time
...
@@ -30,7 +30,10 @@ import time
from
generic
import
GenericBaseRecipe
from
generic
import
GenericBaseRecipe
class
GenericSlapRecipe
(
GenericBaseRecipe
):
class
GenericSlapRecipe
(
GenericBaseRecipe
):
"""Base class for all slap.recipe.*"""
"""Base class for all slap.recipe.* needing SLAP informations like instance
parameters.
recipes that don't explicitely need to retrieve from server informations
should use GenericBaseRecipe."""
def
__init__
(
self
,
buildout
,
name
,
options
):
def
__init__
(
self
,
buildout
,
name
,
options
):
"""Default initialisation"""
"""Default initialisation"""
...
...
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