Merge "Do not validate settings of unavailable SR-IOV" into stable/newton

This commit is contained in:
Jenkins 2016-12-29 13:51:35 +00:00 committed by Gerrit Code Review
commit 58da4bbfd6
1 changed files with 7 additions and 0 deletions

View File

@ -1170,6 +1170,13 @@ models.InterfaceAttributes = models.Settings.extend({
options.models = _.extend({nic_attributes: this, default: this}, options.configModels);
var errors = this._super('validate', [attrs, options]);
// FIXME(jkirnosova): the following hack should be removed after fix of sriov.numvfs null value
if (!((options.meta || {}).sriov || {}).available || !this.get('sriov.enabled.value')) {
// clear sriov errors if sriov is unavailable or not enabled
errors = _.omitBy(errors, (value, key) => _.startsWith(key, 'sriov.'));
}
// MTU has a special validation case which depends on DPDK and cant be moved to YAML
// SRIOV virtual functions number has maximum which is set into interface plain object metadata
_.extend(errors, this.validateMTU(options), this.validateSRIOV(options));