Pass interface model to validation

Related-Bug: #1643599

Change-Id: Iafda0ed9a00054e14072876b407f2ad80847ecb6
This commit is contained in:
Julia Aranovich 2016-12-16 10:36:08 +03:00
parent 412f9a29cb
commit 5759b8376c
1 changed files with 9 additions and 5 deletions

View File

@ -602,10 +602,14 @@ var EditNodeInterfacesScreen = React.createClass({
var errors = {};
interfaces.each((ifc) => {
if (!_.includes(slaveInterfaceNames, ifc.get('name'))) {
var interfaceErrors = ifc.validate(
{networkingParameters, networks},
{cluster, configModels, meta: ifc.get('meta') || {}}
);
var interfaceErrors = ifc.validate({networkingParameters, networks}, {
cluster,
configModels: _.extend({}, configModels, {
[ifc.isBond() ? 'bond_attributes' : 'nic_attributes']: ifc.get('attributes'),
default: ifc.get('attributes')
}),
meta: ifc.get('meta') || {}
});
if (!_.isEmpty(interfaceErrors)) errors[ifc.get('name')] = interfaceErrors;
}
});
@ -830,7 +834,7 @@ var EditNodeInterfacesScreen = React.createClass({
return !_.includes(slaveInterfaceNames, ifcName) && (
<NodeInterfaceDropTarget
{... _.pick(this.props,
'cluster', 'nodes', 'interfaces', 'configModels', 'bondAttributeNames'
'cluster', 'nodes', 'interfaces', 'bondAttributeNames'
)}
{... _.pick(this,
'validate', 'removeInterfaceFromBond', 'getAvailableBondingTypes'