Update to use setProjectid helper function

This commit is contained in:
Hany Fahim 2016-04-11 08:22:01 -04:00
parent 44fc1b5d80
commit 3135706d1f
1 changed files with 2 additions and 9 deletions

View File

@ -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)