Merge "Pass interface model to validation"
This commit is contained in:
commit
1bc84c472e
|
@ -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