

def _create_interfaces_from_meta(self, node):
    for interface in node.meta['interfaces']:
        interface = NodeNICInterface(mac=interface.get('mac'), name=interface.get('name'), ip_addr=interface.get('ip'), netmask=interface.get('netmask'))
        self.db.add(interface)
        node.nic_interfaces.append(interface)
    self.db.flush()
    if node.cluster_id:
        self.network_manager.assign_networks_by_default(node)
    if (node.nic_interfaces and (not filter((lambda i: (node.mac == i.mac)), node.nic_interfaces))):
        node.nic_interfaces[0].mac = node.mac
    self.db.commit()

dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/test/base.py EnvironmentManager._create_interfaces_from_meta/original