Fix meta of a new bond

Closes-bug: #1653058

Change-Id: Ic8bcb7c6c2e0b197895bce879472b7b58cf50900
This commit is contained in:
Julia Aranovich 2016-12-29 11:32:56 +03:00
parent e568a1cb1b
commit 35395ffded
1 changed files with 10 additions and 2 deletions

View File

@ -364,7 +364,6 @@ var EditNodeInterfacesScreen = React.createClass({
});
this.updateWithLimitations(updatedIfc, ifc);
});
return Backbone.sync('update', node.interfaces, {url: _.result(node, 'url') + '/interfaces'});
}))
.then(
@ -453,6 +452,14 @@ var EditNodeInterfacesScreen = React.createClass({
)
});
var bondMeta = {
dpdk: {
available: _.every(interfaces,
(ifc) => ((ifc.get('meta') || {}).dpdk || {}).available !== false
)
}
};
// populate bond attributes with first slave values
var firstSlaveAttributes = interfaces[0].get('attributes');
_.each(bondAttributes.attributes, (section, sectionName) => {
@ -474,7 +481,8 @@ var EditNodeInterfacesScreen = React.createClass({
assigned_networks: new models.InterfaceNetworks(),
slaves: _.invokeMap(interfaces, 'pick', 'name'),
state: 'down',
attributes: bondAttributes
attributes: bondAttributes,
meta: bondMeta
});
this.updateBondOffloading(bond, interfaces);
} else {