Write docstring for librecipes class, issue deprecation warning for oldest one.

parent ec1ffb70
......@@ -236,6 +236,8 @@ class BaseSlapRecipe:
return 'insecure'
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.cert_file)
self.computer_partition = self.slap.registerComputerPartition(
......
......@@ -36,6 +36,8 @@ import pkg_resources
import zc.buildout
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']
FALSE_VALUES = ['n', 'no', '0', 'false']
......@@ -145,9 +147,6 @@ class GenericBaseRecipe(object):
* 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 = ''
if auth is not None:
auth = tuple(auth)
......
......@@ -30,7 +30,10 @@ import time
from generic import 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):
"""Default initialisation"""
......
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