Skip to content

Commit 1b6b293

Browse files
Fix userdatadetails
2 parents 161e222 + 3aaf3aa commit 1b6b293

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

cloudstack/AutoScaleService.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -651,8 +651,7 @@ func (p *CreateAutoScaleVmProfileParams) toURLValues() url.Values {
651651
if v, found := p.p["userdatadetails"]; found {
652652
m := v.(map[string]string)
653653
for i, k := range getSortedKeysFromMap(m) {
654-
u.Set(fmt.Sprintf("userdatadetails[%d].key", i), k)
655-
u.Set(fmt.Sprintf("userdatadetails[%d].value", i), m[k])
654+
u.Set(fmt.Sprintf("userdatadetails[%d].%s", i, k), m[k])
656655
}
657656
}
658657
if v, found := p.p["userdataid"]; found {
@@ -4709,8 +4708,7 @@ func (p *UpdateAutoScaleVmProfileParams) toURLValues() url.Values {
47094708
if v, found := p.p["userdatadetails"]; found {
47104709
m := v.(map[string]string)
47114710
for i, k := range getSortedKeysFromMap(m) {
4712-
u.Set(fmt.Sprintf("userdatadetails[%d].key", i), k)
4713-
u.Set(fmt.Sprintf("userdatadetails[%d].value", i), m[k])
4711+
u.Set(fmt.Sprintf("userdatadetails[%d].%s", i, k), m[k])
47144712
}
47154713
}
47164714
if v, found := p.p["userdataid"]; found {

cloudstack/VirtualMachineService.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,8 +1512,7 @@ func (p *DeployVirtualMachineParams) toURLValues() url.Values {
15121512
if v, found := p.p["userdatadetails"]; found {
15131513
m := v.(map[string]string)
15141514
for i, k := range getSortedKeysFromMap(m) {
1515-
u.Set(fmt.Sprintf("userdatadetails[%d].key", i), k)
1516-
u.Set(fmt.Sprintf("userdatadetails[%d].value", i), m[k])
1515+
u.Set(fmt.Sprintf("userdatadetails[%d].%s", i, k), m[k])
15171516
}
15181517
}
15191518
if v, found := p.p["userdataid"]; found {
@@ -8398,8 +8397,7 @@ func (p *ResetUserDataForVirtualMachineParams) toURLValues() url.Values {
83988397
if v, found := p.p["userdatadetails"]; found {
83998398
m := v.(map[string]string)
84008399
for i, k := range getSortedKeysFromMap(m) {
8401-
u.Set(fmt.Sprintf("userdatadetails[%d].key", i), k)
8402-
u.Set(fmt.Sprintf("userdatadetails[%d].value", i), m[k])
8400+
u.Set(fmt.Sprintf("userdatadetails[%d].%s", i, k), m[k])
84038401
}
84048402
}
84058403
if v, found := p.p["userdataid"]; found {
@@ -10447,8 +10445,7 @@ func (p *UpdateVirtualMachineParams) toURLValues() url.Values {
1044710445
if v, found := p.p["userdatadetails"]; found {
1044810446
m := v.(map[string]string)
1044910447
for i, k := range getSortedKeysFromMap(m) {
10450-
u.Set(fmt.Sprintf("userdatadetails[%d].key", i), k)
10451-
u.Set(fmt.Sprintf("userdatadetails[%d].value", i), m[k])
10448+
u.Set(fmt.Sprintf("userdatadetails[%d].%s", i, k), m[k])
1045210449
}
1045310450
}
1045410451
if v, found := p.p["userdataid"]; found {

cloudstack/VirtualNetworkFunctionsService.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,7 @@ func (p *DeployVnfApplianceParams) toURLValues() url.Values {
420420
if v, found := p.p["userdatadetails"]; found {
421421
m := v.(map[string]string)
422422
for i, k := range getSortedKeysFromMap(m) {
423-
u.Set(fmt.Sprintf("userdatadetails[%d].key", i), k)
424-
u.Set(fmt.Sprintf("userdatadetails[%d].value", i), m[k])
423+
u.Set(fmt.Sprintf("userdatadetails[%d].%s", i, k), m[k])
425424
}
426425
}
427426
if v, found := p.p["userdataid"]; found {

generate/generate.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,6 +1403,8 @@ func (s *service) generateConvertCode(cmd, name, typ string) {
14031403
pn(" u.Set(fmt.Sprintf(\"%s[%%d].%%s\", i, k), m[k])", name)
14041404
}
14051405
}
1406+
case "userdatadetails":
1407+
pn(" u.Set(fmt.Sprintf(\"%s[%%d].%%s\", i, k), m[k])", name)
14061408
case "serviceproviderlist":
14071409
pn(" u.Set(fmt.Sprintf(\"%s[%%d].service\", i), k)", name)
14081410
pn(" u.Set(fmt.Sprintf(\"%s[%%d].provider\", i), m[k])", name)

0 commit comments

Comments
 (0)