Skip to content

Error to create metadata files with userdatadetails #104

@lucasdk3

Description

@lucasdk3

Hi, i have a problem to create metadata files with userdatadetails, with the current configuration it is creating only one key file and one value file, this way:
Image

current code:

if v, found := p.p["userdatadetails"]; found {

if v, found := p.p["userdatadetails"]; found {
	m := v.(map[string]string)
	for i, k := range getSortedKeysFromMap(m) {
		u.Set(fmt.Sprintf("userdatadetails[%d].key", i), k)
		u.Set(fmt.Sprintf("userdatadetails[%d].value", i), m[k])
	}
}

the cloudstack api use with this form:

Image

to fix this problem is necessary change the code for this mode:

if v, found := p.p["userdatadetails"]; found {
	m := v.(map[string]string)
	for i, k := range getSortedKeysFromMap(m) {
		u.Set(fmt.Sprintf("userdatadetails[%d].%s", i, k), m[k])
	}
}

The error have a big impact in my current work, if possible, correct it as soon as possible.
Thanks by attention, Lucas Batista - Wevy Cloud (Brazil)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions