summaryrefslogtreecommitdiffstats
path: root/deploy/cloud
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/cloud')
-rw-r--r--deploy/cloud/configure_nodes.py39
1 files changed, 16 insertions, 23 deletions
diff --git a/deploy/cloud/configure_nodes.py b/deploy/cloud/configure_nodes.py
index f9f65afb5..a50973af6 100644
--- a/deploy/cloud/configure_nodes.py
+++ b/deploy/cloud/configure_nodes.py
@@ -32,27 +32,20 @@ class ConfigureNodes(object):
def config_nodes(self):
log('Configure nodes')
- # Super dirty fix since Fuel 7 requires user defined roles to be
- # assigned before anything else (BUG fixed in Fuel 8)!
+ # Assign nodes to environment with given roles
for node_id, roles_blade in self.node_id_roles_dict.iteritems():
- if "opendaylight" in roles_blade[0] or "onos" in roles_blade[0] or "contrail" in roles_blade[0]:
- exec_cmd('fuel node set --node-id %s --role %s --env %s'
- % (node_id, roles_blade[0], self.env_id))
+ exec_cmd('fuel node set --node-id %s --role %s --env %s'
+ % (node_id, roles_blade[0], self.env_id))
for node_id, roles_blade in self.node_id_roles_dict.iteritems():
- if "opendaylight" not in roles_blade[0] and "onos" not in roles_blade[0] and "contrail" not in roles_blade[0]:
- exec_cmd('fuel node set --node-id %s --role %s --env %s'
- % (node_id, roles_blade[0], self.env_id))
-
- for node_id, roles_blade in self.node_id_roles_dict.iteritems():
- # Modify node attributes
- self.download_attributes(node_id)
- self.modify_node_attributes(node_id, roles_blade)
- self.upload_attributes(node_id)
# Modify interfaces configuration
self.download_interface_config(node_id)
self.modify_node_interface(node_id, roles_blade)
self.upload_interface_config(node_id)
+ # Modify node attributes
+ self.download_attributes(node_id)
+ self.modify_node_attributes(node_id, roles_blade)
+ self.upload_attributes(node_id)
# Currently not used, we use default deployment facts
# which are generated by fuel based on type segmentation
@@ -142,7 +135,8 @@ class ConfigureNodes(object):
# ens5:
# - interface_properties:
# dpdk:
- # enabled: true
+ # enabled:
+ # value: true
# - private
# ens6:
# - public
@@ -169,19 +163,19 @@ class ConfigureNodes(object):
if interface['name'] in interface_config:
for prop in interface_config[interface['name']]:
net = {}
- #net name
+ # net name
if isinstance(prop, six.string_types):
net['id'] = net_name_id[prop]
net['name'] = prop
interface['assigned_networks'].append(net)
- #network properties
+ # network properties
elif isinstance(prop, dict):
- if not 'interface_properties' in prop:
- log('Interface configuration contain unknow dict: %s' % prop)
+ if 'interface_properties' not in prop:
+ log('Interface configuration contains unknown dict: %s' % prop)
continue
- interface['interface_properties'] = \
- self._merge_dicts(interface.get('interface_properties', {}),
- prop.get('interface_properties', {}))
+ interface['attributes'] = self._merge_dicts(
+ interface.get('attributes', {}),
+ prop.get('interface_properties', {}))
with io.open(interface_yaml, 'w') as stream:
yaml.dump(interfaces, stream, default_flow_style=False)
@@ -198,4 +192,3 @@ class ConfigureNodes(object):
continue
result[k] = copy.deepcopy(v)
return result
-