diff --git a/setup.py b/setup.py index df5eb713bd231d5f26de3d7eb8834a4815365ee0..df1c96664d114a1dfd656c1d6ec28cb41f5dfb1e 100644 --- a/setup.py +++ b/setup.py @@ -93,6 +93,7 @@ setup(name=name, 'publish = slapos.recipe.publish:Recipe', 'publishurl = slapos.recipe.publishurl:Recipe', 'pwgen = slapos.recipe.pwgen:Recipe', + 'pwgen.stable = slapos.recipe.pwgen:StablePasswordGeneratorRecipe', 'proactive = slapos.recipe.proactive:Recipe', 'request = slapos.recipe.request:Recipe', 'seleniumrunner = slapos.recipe.seleniumrunner:Recipe', diff --git a/slapos/recipe/pwgen.py b/slapos/recipe/pwgen.py index 06181f7f759bdcbc1ab03d93f09699285ba92339..135c0d5949681cd4856a0451e2e32276774e25d4 100644 --- a/slapos/recipe/pwgen.py +++ b/slapos/recipe/pwgen.py @@ -42,3 +42,17 @@ class Recipe(GenericBaseRecipe): options['password'] = password update = install = lambda self: [] + +class StablePasswordGeneratorRecipe(GenericBaseRecipe): + """ + The purpose of this class is to generate a password which doesn't change + from one execution to the next (hence "stable"), so the generated password + doesn't change on each slapgrid-sr execution. + + See GenericBaseRecipe.generatePassword . + """ + + def _options(self, options): + options['password'] = self.generatePassword() + + update = install = lambda self: []