Only set projectID if it is set
This commit is contained in:
parent
ea89339a43
commit
d212b278a9
|
@ -161,7 +161,10 @@ func resourceCloudStackVPCRead(d *schema.ResourceData, meta interface{}) error {
|
|||
p := cs.Address.NewListPublicIpAddressesParams()
|
||||
p.SetVpcid(d.Id())
|
||||
p.SetIssourcenat(true)
|
||||
p.SetProjectid(v.Projectid)
|
||||
if project, ok := d.GetOk("project"); ok {
|
||||
p.SetProjectid(v.Projectid)
|
||||
}
|
||||
|
||||
l, e := cs.Address.ListPublicIpAddresses(p)
|
||||
if (e == nil) && (l.Count == 1) {
|
||||
d.Set("source_nat_ip", l.PublicIpAddresses[0].Ipaddress)
|
||||
|
|
Loading…
Reference in New Issue