summaryrefslogtreecommitdiffstats
path: root/fuel/deploy/execution_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/execution_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/execution_environment.py')
-rw-r--r--fuel/deploy/execution_environment.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/fuel/deploy/execution_environment.py b/fuel/deploy/execution_environment.py
new file mode 100644
index 0000000..e671463
--- /dev/null
+++ b/fuel/deploy/execution_environment.py
@@ -0,0 +1,46 @@
+###############################################################################
+# 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 yaml
+import io
+import os
+
+import common
+from environments.libvirt_environment import LibvirtEnvironment
+from environments.virtual_fuel import VirtualFuel
+
+exec_cmd = common.exec_cmd
+err = common.err
+log = common.log
+check_dir_exists = common.check_dir_exists
+check_file_exists = common.check_file_exists
+check_if_root = common.check_if_root
+ArgParser = common.ArgParser
+
+
+class ExecutionEnvironment(object):
+
+ def __new__(cls, storage_dir, pxe_bridge, dha_path, dea):
+
+ with io.open(dha_path) as yaml_file:
+ dha_struct = yaml.load(yaml_file)
+
+ type = dha_struct['adapter']
+
+ root_dir = os.path.dirname(os.path.realpath(__file__))
+
+ if cls is ExecutionEnvironment:
+ if type == 'libvirt':
+ return LibvirtEnvironment(storage_dir, dha_path, dea, root_dir)
+
+ if type == 'ipmi' or type == 'hp':
+ return VirtualFuel(storage_dir, pxe_bridge, dha_path, root_dir)
+
+ return super(ExecutionEnvironment, cls).__new__(cls)