Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assign_sla() should overwrite inherited SLA assignments with a direct assignment #17

Open
drew-russell opened this issue Feb 20, 2019 · 0 comments

Comments

@drew-russell
Copy link
Contributor

Is your feature request related to a problem? Please describe.

AssignSLA currently has an idempotence check that will not assign an SLA if its already applied via inheritance. The function should overwrite any inherited assignment with a direct assignment instead.

Describe the solution you'd like

Current:

var currentSLAID string
switch slaID {
case "INHERIT":
    currentSLAID = vmSummary.(map[string]interface{})["configuredSlaDomainId"].(string)
default:
    currentSLAID = vmSummary.(map[string]interface{})["effectiveSlaDomainId"].(string)
}

if slaID == currentSLAID {
    return nil, fmt.Errorf("No change required. The vSphere VM '%s' is already assigned to the '%s' SLA Domain", objectName, slaName)
}

Updates:

if slaID == vmSummary.(map[string]interface{})["configuredSlaDomainId"].(string) {
    return nil, fmt.Errorf("No change required. The vSphere VM '%s' is already assigned to the '%s' SLA Domain", objectName, slaName)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants