Replace if/else with simple if (#9913)

This commit is contained in:
Wilken Rivera 2020-09-09 04:24:17 -04:00 committed by GitHub
parent 8aaa1bd7a6
commit 0719f906d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 5 deletions

View File

@ -73,12 +73,11 @@ func getCommandArgs(bootDrive string, state multistep.StateBag) ([]string, error
var deviceArgs []string
var driveArgs []string
var commHostPort int
var vnc string
if !config.VNCUsePassword {
vnc = fmt.Sprintf("%s:%d", vncIP, vncPort-config.VNCPortMin)
} else {
vnc = fmt.Sprintf("%s:%d,password", vncIP, vncPort-config.VNCPortMin)
vncPort = vncPort - config.VNCPortMin
vnc := fmt.Sprintf("%s:%d", vncIP, vncPort)
if config.VNCUsePassword {
vnc = fmt.Sprintf("%s:%d,password", vncIP, vncPort)
}
if config.QMPEnable {