If there is a project supplied, we retrieve and set the project id
(p cloudstack.ProjectIDSetter, cs *cloudstack.CloudStackClient, d *schema.ResourceData)
| 145 | |
| 146 | // If there is a project supplied, we retrieve and set the project id |
| 147 | func setProjectid(p cloudstack.ProjectIDSetter, cs *cloudstack.CloudStackClient, d *schema.ResourceData) error { |
| 148 | if project, ok := d.GetOk("project"); ok { |
| 149 | projectid, e := retrieveID(cs, "project", project.(string)) |
| 150 | if e != nil { |
| 151 | return e.Error() |
| 152 | } |
| 153 | p.SetProjectid(projectid) |
| 154 | } |
| 155 | |
| 156 | return nil |
| 157 | } |
| 158 | |
| 159 | // importStatePassthrough is a generic importer with project support. |
| 160 | func importStatePassthrough(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { |
no test coverage detected