Allow for -1 for Zone ID, which is valid in CloudStack
This commit is contained in:
parent
4502c32840
commit
03d7c1fa7d
|
@ -219,9 +219,14 @@ func resourceCloudStackTemplateRead(d *schema.ResourceData, meta interface{}) er
|
|||
d.Set("password_enabled", t.Passwordenabled)
|
||||
d.Set("is_ready", t.Isready)
|
||||
|
||||
if t.Zoneid == "" {
|
||||
d.Set("zone", "-1")
|
||||
} else {
|
||||
setValueOrUUID(d, "zone", t.Zonename, t.Zoneid)
|
||||
}
|
||||
|
||||
setValueOrUUID(d, "os_type", t.Ostypename, t.Ostypeid)
|
||||
setValueOrUUID(d, "zone", t.Zonename, t.Zoneid)
|
||||
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -53,6 +53,9 @@ func retrieveUUID(cs *cloudstack.CloudStackClient, name, value string) (uuid str
|
|||
case "network":
|
||||
uuid, err = cs.Network.GetNetworkID(value)
|
||||
case "zone":
|
||||
if value == "-1" {
|
||||
return value, nil
|
||||
}
|
||||
uuid, err = cs.Zone.GetZoneID(value)
|
||||
case "ipaddress":
|
||||
p := cs.Address.NewListPublicIpAddressesParams()
|
||||
|
|
Loading…
Reference in New Issue