Experimental way to configure CO

parent b4186836
...@@ -27,13 +27,14 @@ ...@@ -27,13 +27,14 @@
import os import os
import shutil import shutil
from slapos.recipe.librecipe import GenericSlapRecipe from slapos.recipe.librecipe import GenericSlapRecipe
from subprocess import Popen import shutil
import subprocess
import sys import sys
class Recipe(GenericSlapRecipe): class Recipe(GenericSlapRecipe):
def _install(self): def _install(self):
path_list = [] path_list = []
poc_location = self.buildout['pocdirectory']['poc'] accords_location = self.buildout['accordsdirectory']['accords']
parameter_dict = dict( parameter_dict = dict(
userid=self.options['userid'], userid=self.options['userid'],
...@@ -41,7 +42,7 @@ class Recipe(GenericSlapRecipe): ...@@ -41,7 +42,7 @@ class Recipe(GenericSlapRecipe):
domain=self.options['domain'], domain=self.options['domain'],
openstack_url=self.options['openstack_url'], openstack_url=self.options['openstack_url'],
python_location=sys.executable, python_location=sys.executable,
poc_location=poc_location, accords_location=accords_location,
manifest_name=self.options['manifest-name'], manifest_name=self.options['manifest-name'],
# XXX this is workaround # XXX this is workaround
accords_lib_directory=self.options['accords_lib_directory'], accords_lib_directory=self.options['accords_lib_directory'],
...@@ -70,10 +71,15 @@ class Recipe(GenericSlapRecipe): ...@@ -70,10 +71,15 @@ class Recipe(GenericSlapRecipe):
accords_configuration_parameter_dict)) accords_configuration_parameter_dict))
path_list.append(accords_configuration_file_location) path_list.append(accords_configuration_file_location)
# XXX is it dangerous?
security_path = os.path.join(accords_location, 'security')
if os.path.exists(security_path):
shutil.rmtree(security_path)
# Initiate configuration # Initiate configuration
Popen('./accords-config', subprocess.check_call('./accords-config',
cwd=poc_location cwd=accords_location
).communicate() )
# Generate manifest # Generate manifest
manifest_origin_location = self.options['manifest-source'] manifest_origin_location = self.options['manifest-source']
......
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