X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=deploy%2Fcloud%2Fconfigure_nodes.py;h=a50973af6d7f05d1eea4373cea8ecfadf97deddf;hb=98f171c82636c29a9cfd5c94c8e7aac7ca7af41b;hp=ea50307b17f993cb4250d0ea083f274efecd1934;hpb=8eeadbc08d8ae2efd5958fd639f910b77071d002;p=fuel.git diff --git a/deploy/cloud/configure_nodes.py b/deploy/cloud/configure_nodes.py index ea50307b1..a50973af6 100644 --- a/deploy/cloud/configure_nodes.py +++ b/deploy/cloud/configure_nodes.py @@ -8,7 +8,6 @@ ############################################################################### import copy -import glob import io import six @@ -33,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 @@ -143,7 +135,8 @@ class ConfigureNodes(object): # ens5: # - interface_properties: # dpdk: - # enabled: true + # enabled: + # value: true # - private # ens6: # - public @@ -170,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) @@ -199,4 +192,3 @@ class ConfigureNodes(object): continue result[k] = copy.deepcopy(v) return result -