Skip to content

Commit 7852248

Browse files
committed
Moved project block down
1 parent fc89f57 commit 7852248

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

builtin/providers/cloudstack/resource_cloudstack_template.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,6 @@ func resourceCloudStackTemplateCreate(d *schema.ResourceData, meta interface{})
130130
return e.Error()
131131
}
132132

133-
// If there is a project supplied, we retrieve and set the project id
134-
if project, ok := d.GetOk("project"); ok {
135-
// Retrieve the project UUID
136-
projectid, e := retrieveUUID(cs, "project", project.(string))
137-
if e != nil {
138-
return e.Error()
139-
}
140-
// Set the default project ID
141-
p.SetProjectid(projectid)
142-
}
143-
144133
// Retrieve the zone UUID
145134
zoneid, e := retrieveUUID(cs, "zone", d.Get("zone").(string))
146135
if e != nil {
@@ -178,6 +167,17 @@ func resourceCloudStackTemplateCreate(d *schema.ResourceData, meta interface{})
178167
p.SetPasswordenabled(v.(bool))
179168
}
180169

170+
// If there is a project supplied, we retrieve and set the project id
171+
if project, ok := d.GetOk("project"); ok {
172+
// Retrieve the project UUID
173+
projectid, e := retrieveUUID(cs, "project", project.(string))
174+
if e != nil {
175+
return e.Error()
176+
}
177+
// Set the default project ID
178+
p.SetProjectid(projectid)
179+
}
180+
181181
// Create the new template
182182
r, err := cs.Template.RegisterTemplate(p)
183183
if err != nil {

0 commit comments

Comments
 (0)