mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
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 := cs.Address.NewListPublicIpAddressesParams()
|
||||||
p.SetVpcid(d.Id())
|
p.SetVpcid(d.Id())
|
||||||
p.SetIssourcenat(true)
|
p.SetIssourcenat(true)
|
||||||
p.SetProjectid(v.Projectid)
|
if project, ok := d.GetOk("project"); ok {
|
||||||
|
p.SetProjectid(v.Projectid)
|
||||||
|
}
|
||||||
|
|
||||||
l, e := cs.Address.ListPublicIpAddresses(p)
|
l, e := cs.Address.ListPublicIpAddresses(p)
|
||||||
if (e == nil) && (l.Count == 1) {
|
if (e == nil) && (l.Count == 1) {
|
||||||
d.Set("source_nat_ip", l.PublicIpAddresses[0].Ipaddress)
|
d.Set("source_nat_ip", l.PublicIpAddresses[0].Ipaddress)
|
||||||
|
Loading…
Reference in New Issue
Block a user