diff options
author | Szilard Cserey <szilard.cserey@ericsson.com> | 2015-08-18 19:47:50 +0200 |
---|---|---|
committer | Szilard Cserey <szilard.cserey@ericsson.com> | 2015-09-16 11:33:23 +0200 |
commit | 49aacd62348d7edf91c5b9bbd40d31708610e1e5 (patch) | |
tree | 0dc637b67d2c56ea71c995ca26113df6c81ce16f /fuel/deploy/cloud/configure_nodes.py | |
parent | 54f12d2bdd72ae12061ebf62c5b70f357850c411 (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_nodes.py')
-rw-r--r-- | fuel/deploy/cloud/configure_nodes.py | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/fuel/deploy/cloud/configure_nodes.py b/fuel/deploy/cloud/configure_nodes.py index a2f2a10..06199d2 100644 --- a/fuel/deploy/cloud/configure_nodes.py +++ b/fuel/deploy/cloud/configure_nodes.py @@ -1,3 +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 yaml import io @@ -12,6 +22,7 @@ parse = common.parse err = common.err check_file_exists = common.check_file_exists log = common.log +backup = common.backup class ConfigureNodes(object): @@ -39,18 +50,18 @@ class ConfigureNodes(object): def modify_node_network_schemes(self, node_id, roles_blade): log('Modify network transformations for node %s' % node_id) type = self.dea.get_node_property(roles_blade[1], 'transformations') - transformations = self.dea.get_transformations(type) - - for node_file in glob.glob('%s/deployment_%s/*_%s.yaml' - % (self.yaml_config_dir, self.env_id, - node_id)): + transformations = self.dea.get_property(type) + deployment_dir = '%s/deployment_%s' % ( + self.yaml_config_dir, self.env_id) + backup(deployment_dir) + for node_file in glob.glob(deployment_dir + '/*_%s.yaml' % node_id): with io.open(node_file) as stream: - node = yaml.load(stream) + node = yaml.load(stream) - node['network_scheme']['transformations'] = transformations + node['network_scheme'].update(transformations) with io.open(node_file, 'w') as stream: - yaml.dump(node, stream, default_flow_style=False) + yaml.dump(node, stream, default_flow_style=False) def download_deployment_config(self): log('Download deployment config for environment %s' % self.env_id) @@ -77,6 +88,7 @@ class ConfigureNodes(object): interface_yaml = ('%s/node_%s/interfaces.yaml' % (self.yaml_config_dir, node_id)) check_file_exists(interface_yaml) + backup(interface_yaml) with io.open(interface_yaml) as stream: interfaces = yaml.load(stream) @@ -84,10 +96,10 @@ class ConfigureNodes(object): net_name_id = {} for interface in interfaces: for network in interface['assigned_networks']: - net_name_id[network['name']] = network['id'] + net_name_id[network['name']] = network['id'] type = self.dea.get_node_property(roles_blade[1], 'interfaces') - interface_config = self.dea.get_interfaces(type) + interface_config = self.dea.get_property(type) for interface in interfaces: interface['assigned_networks'] = [] @@ -99,4 +111,4 @@ class ConfigureNodes(object): interface['assigned_networks'].append(net) with io.open(interface_yaml, 'w') as stream: - yaml.dump(interfaces, stream, default_flow_style=False)
\ No newline at end of file + yaml.dump(interfaces, stream, default_flow_style=False) |