Skip to content

Commit

Permalink
F #6782 Extend GOCA OSVec struct (#3301)
Browse files Browse the repository at this point in the history
Signed-off-by: Jaime <[email protected]>
  • Loading branch information
jaimecb authored Nov 20, 2024
1 parent 9d5da2d commit bb65c22
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
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

0 comments on commit bb65c22

Please sign in to comment.