Simplify version check for port count argument
Might be personal preference, but I think this reads more clearly
This commit is contained in:
parent
758a56f91b
commit
346f5d9bba
|
@ -25,11 +25,12 @@ func (d *VBox42Driver) CreateSATAController(vmName string, name string, portcoun
|
|||
}
|
||||
|
||||
portCountArg := "--portcount"
|
||||
if strings.HasPrefix(version, "0.") || strings.HasPrefix(version, "1.") || strings.HasPrefix(version, "2.") ||
|
||||
strings.HasPrefix(version, "3.") || strings.HasPrefix(version, "4.0") || strings.HasPrefix(version, "4.1") ||
|
||||
strings.HasPrefix(version, "4.2") {
|
||||
|
||||
for _, prefix := range [7]string{"0.", "1.", "2.", "3.", "4.0", "4.1", "4.2"} {
|
||||
if strings.HasPrefix(version, prefix) {
|
||||
portCountArg = "--sataportcount"
|
||||
}
|
||||
}
|
||||
|
||||
command := []string{
|
||||
"storagectl", vmName,
|
||||
|
|
Loading…
Reference in New Issue