summaryrefslogtreecommitdiffstats
path: root/fuel/deploy/cloud/configure_environment.py
diff options
context:
space:
mode:
authorSzilard Cserey <szilard.cserey@ericsson.com>2015-08-18 19:47:50 +0200
committerSzilard Cserey <szilard.cserey@ericsson.com>2015-09-09 17:16:55 +0200
commita98bf1747db2894394da929d07bde78a1ec19015 (patch)
tree8ac5bafd6120933e66088741205c621ddf664224 /fuel/deploy/cloud/configure_environment.py
parent153ad3e4d97f19ab5e465df6a46e26b7c7935058 (diff)
Autodeployer support for ODL Plugin installation + Fuel 6.1
- Opendaylight plugin installation - Adapting Autodeployer to Fuel 6.1 - restarting blades that couldn't be discovered Fuel in time BGS-87 Autodeployment restarts blade if that has not been discovered by Fuel BGS-90 Fuel 6.1 and Opendaylight Fuel plugin install support for Autodeployer Change-Id: I83aab3f8caf368a70fd3f2b67c7ba1b6191993c6 Signed-off-by: Szilard Cserey <szilard.cserey@ericsson.com>
Diffstat (limited to 'fuel/deploy/cloud/configure_environment.py')
-rw-r--r--fuel/deploy/cloud/configure_environment.py41
1 files changed, 23 insertions, 18 deletions
diff --git a/fuel/deploy/cloud/configure_environment.py b/fuel/deploy/cloud/configure_environment.py
index d0037d7..2d68c1b 100644
--- a/fuel/deploy/cloud/configure_environment.py
+++ b/fuel/deploy/cloud/configure_environment.py
@@ -1,6 +1,13 @@
+###############################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+# szilard.cserey@ericsson.com
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+###############################################################################
+
import common
-import os
-import shutil
from configure_settings import ConfigureSettings
from configure_network import ConfigureNetwork
@@ -14,6 +21,9 @@ exec_cmd = common.exec_cmd
parse = common.parse
err = common.err
log = common.log
+delete = common.delete
+create_dir_if_not_exists = common.create_dir_if_not_exists
+
class ConfigureEnvironment(object):
@@ -21,7 +31,6 @@ class ConfigureEnvironment(object):
self.env_id = None
self.dea = dea
self.yaml_config_dir = yaml_config_dir
- self.env_name = self.dea.get_property('environment_name')
self.release_id = release_id
self.node_id_roles_dict = node_id_roles_dict
self.required_networks = []
@@ -36,21 +45,20 @@ class ConfigureEnvironment(object):
def configure_environment(self):
log('Configure environment')
- if os.path.exists(self.yaml_config_dir):
- log('Deleting existing config directory %s' % self.yaml_config_dir)
- shutil.rmtree(self.yaml_config_dir)
- log('Creating new config directory %s' % self.yaml_config_dir)
- os.makedirs(self.yaml_config_dir)
-
- mode = self.dea.get_property('environment_mode')
+ delete(self.yaml_config_dir)
+ create_dir_if_not_exists(self.yaml_config_dir)
+ env_name = self.dea.get_env_name()
+ env_mode = self.dea.get_env_mode()
+ env_net_segment_type = self.dea.get_env_net_segment_type()
log('Creating environment %s release %s, mode %s, network-mode neutron'
- ', net-segment-type vlan' % (self.env_name, self.release_id, mode))
+ ', net-segment-type %s'
+ % (env_name, self.release_id, env_mode, env_net_segment_type))
exec_cmd('fuel env create --name %s --release %s --mode %s '
- '--network-mode neutron --net-segment-type vlan'
- % (self.env_name, self.release_id, mode))
+ '--network-mode neutron --net-segment-type %s'
+ % (env_name, self.release_id, env_mode, env_net_segment_type))
- if not self.env_exists(self.env_name):
- err('Failed to create environment %s' % self.env_name)
+ if not self.env_exists(env_name):
+ err('Failed to create environment %s' % env_name)
self.config_settings()
self.config_network()
self.config_nodes()
@@ -68,6 +76,3 @@ class ConfigureEnvironment(object):
nodes = ConfigureNodes(self.yaml_config_dir, self.env_id,
self.node_id_roles_dict, self.dea)
nodes.config_nodes()
-
-
-