Update to use setProjectid helper function
This commit is contained in:
parent
44fc1b5d80
commit
3135706d1f
|
@ -213,15 +213,8 @@ func resourceCloudStackPortForwardRead(d *schema.ResourceData, meta interface{})
|
||||||
p.SetIpaddressid(d.Id())
|
p.SetIpaddressid(d.Id())
|
||||||
p.SetListall(true)
|
p.SetListall(true)
|
||||||
|
|
||||||
// If there is a project supplied, we retrieve and set the project id
|
if err := setProjectid(p, cs, d); err != nil {
|
||||||
if project, ok := d.GetOk("project"); ok {
|
return err
|
||||||
// Retrieve the project ID
|
|
||||||
projectid, e := retrieveID(cs, "project", project.(string))
|
|
||||||
if e != nil {
|
|
||||||
return e.Error()
|
|
||||||
}
|
|
||||||
// Set the default project ID
|
|
||||||
p.SetProjectid(projectid)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
l, err := cs.Firewall.ListPortForwardingRules(p)
|
l, err := cs.Firewall.ListPortForwardingRules(p)
|
||||||
|
|
Loading…
Reference in New Issue