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

only set randompasswd in graphics template if it's true #535

Merged
merged 4 commits into from
Oct 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions opennebula/shared_schemas.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,13 +652,14 @@ func addGraphic(tpl *vm.Template, graphics []interface{}) {
case "passwd":
tpl.AddIOGraphic(vmk.Passwd, v.(string))
case "random_passwd":
// Convert bool to string
tpl.AddIOGraphic(vmk.RandomPassword, map[bool]string{true: "YES", false: "NO"}[v.(bool)])
// only set random_passwd if it's set to true -- older OpenNebula versions will consider any
// non-zero string as a yes
if v.(bool) {
tpl.AddIOGraphic(vmk.RandomPassword, "YES")
}
}

}
}

}
}

Expand Down
Loading