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

F #6782: Extend GOCA OSVec keys #6795

Closed
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions src/oca/go/src/goca/dynamic/dyntemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,8 @@ func MakePair(key string, v interface{}) (*Pair, error) {
val = fmt.Sprintf("%f", v)
case int, uint:
val = fmt.Sprintf("%d", v)
case bool:
val = strconv.FormatBool(v)
case string:
val = v
}
Expand Down
24 changes: 14 additions & 10 deletions src/oca/go/src/goca/schemas/vm/keys/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,20 @@ type OS string
const (
OSVec string = "OS"

Arch OS = "ARCH"
Machine OS = "MACHINE"
Kernel OS = "KERNEL"
KernelDS OS = "KERNEL_DS"
Initrd OS = "INITRD"
InitrdDS OS = "INITRD_DS"
Root OS = "ROOT"
KernelCmd OS = "KERNEL_CMD"
Bootloader OS = "BOOTLOADER"
Boot OS = "BOOT"
Arch OS = "ARCH"
Machine OS = "MACHINE"
Kernel OS = "KERNEL"
KernelDS OS = "KERNEL_DS"
Initrd OS = "INITRD"
InitrdDS OS = "INITRD_DS"
Root OS = "ROOT"
KernelCmd OS = "KERNEL_CMD"
Bootloader OS = "BOOTLOADER"
Boot OS = "BOOT"
SDDiskBus OS = "SD_DISK_BUS"
UUID OS = "UUID"
Firmware OS = "FIRMWARE"
FirmwareSecure OS = "FIRMWARE_SECURE"
)

// CPUModel define keys for the VM CPU model
Expand Down
2 changes: 1 addition & 1 deletion src/oca/go/src/goca/schemas/vm/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func (t *Template) GetShowback(key keys.Showback) (string, error) {

// OS template part

func (t *Template) AddOS(key keys.OS, value string) error {
func (t *Template) AddOS(key keys.OS, value interface{}) error {
return t.Template.AddPairToVec(keys.OSVec, string(key), value)
}

Expand Down