Pass interface model to validation
Related-Bug: #1643599 Change-Id: Iafda0ed9a00054e14072876b407f2ad80847ecb6
This commit is contained in:
parent
412f9a29cb
commit
5759b8376c
|
@ -602,10 +602,14 @@ var EditNodeInterfacesScreen = React.createClass({
|
||||||
var errors = {};
|
var errors = {};
|
||||||
interfaces.each((ifc) => {
|
interfaces.each((ifc) => {
|
||||||
if (!_.includes(slaveInterfaceNames, ifc.get('name'))) {
|
if (!_.includes(slaveInterfaceNames, ifc.get('name'))) {
|
||||||
var interfaceErrors = ifc.validate(
|
var interfaceErrors = ifc.validate({networkingParameters, networks}, {
|
||||||
{networkingParameters, networks},
|
cluster,
|
||||||
{cluster, configModels, meta: ifc.get('meta') || {}}
|
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;
|
if (!_.isEmpty(interfaceErrors)) errors[ifc.get('name')] = interfaceErrors;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -830,7 +834,7 @@ var EditNodeInterfacesScreen = React.createClass({
|
||||||
return !_.includes(slaveInterfaceNames, ifcName) && (
|
return !_.includes(slaveInterfaceNames, ifcName) && (
|
||||||
<NodeInterfaceDropTarget
|
<NodeInterfaceDropTarget
|
||||||
{... _.pick(this.props,
|
{... _.pick(this.props,
|
||||||
'cluster', 'nodes', 'interfaces', 'configModels', 'bondAttributeNames'
|
'cluster', 'nodes', 'interfaces', 'bondAttributeNames'
|
||||||
)}
|
)}
|
||||||
{... _.pick(this,
|
{... _.pick(this,
|
||||||
'validate', 'removeInterfaceFromBond', 'getAvailableBondingTypes'
|
'validate', 'removeInterfaceFromBond', 'getAvailableBondingTypes'
|
||||||
|
|
Loading…
Reference in New Issue