Commit 27c71ae8 authored by Romain Courteaud's avatar Romain Courteaud

Stabilize KVM password generation.

Password is stored in plaintext on the file system.
parent eed7410e
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
# #
############################################################################## ##############################################################################
from slapos.recipe.librecipe import GenericBaseRecipe from slapos.recipe.librecipe import GenericBaseRecipe
import binascii
import os import os
import sys import sys
...@@ -33,11 +32,6 @@ class Recipe(GenericBaseRecipe): ...@@ -33,11 +32,6 @@ class Recipe(GenericBaseRecipe):
""" """
kvm instance configuration. kvm instance configuration.
""" """
def __init__(self, buildout, name, options):
options['passwd'] = binascii.hexlify(os.urandom(4))
return GenericBaseRecipe.__init__(self, buildout, name, options)
def install(self): def install(self):
config = dict( config = dict(
tap_interface=self.options['tap'], tap_interface=self.options['tap'],
......
...@@ -35,6 +35,11 @@ ca-dir = $${rootdirectory:srv}/ssl ...@@ -35,6 +35,11 @@ ca-dir = $${rootdirectory:srv}/ssl
recipe = slapos.cookbook:generate.mac recipe = slapos.cookbook:generate.mac
storage-path = $${rootdirectory:srv}/mac storage-path = $${rootdirectory:srv}/mac
[gen-passwd]
recipe = slapos.cookbook:generate.password
storage-path = $${rootdirectory:srv}/passwd
bytes = 4
[kvm-instance] [kvm-instance]
recipe = slapos.cookbook:kvm recipe = slapos.cookbook:kvm
vnc-ip = $${slap-network-information:local-ipv4} vnc-ip = $${slap-network-information:local-ipv4}
...@@ -54,6 +59,7 @@ controller-path = $${basedirectory:services}/kvm_controller ...@@ -54,6 +59,7 @@ controller-path = $${basedirectory:services}/kvm_controller
shell-path = ${dash:location}/bin/dash shell-path = ${dash:location}/bin/dash
qemu-path = ${kvm:location}/bin/qemu-system-x86_64 qemu-path = ${kvm:location}/bin/qemu-system-x86_64
qemu-img-path = ${kvm:location}/bin/qemu-img qemu-img-path = ${kvm:location}/bin/qemu-img
passwd = $${gen-passwd:passwd}
[kvm-promise] [kvm-promise]
recipe = slapos.cookbook:check_port_listening recipe = slapos.cookbook:check_port_listening
......
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