Skip to content

Commit

Permalink
Remove platform constraint for call to expandUsers
Browse files Browse the repository at this point in the history
The api will discard the Users field for servers (VMware templates with DEPLOY_SCRIPT bootstrapmethod) during creation.

Closes #58
  • Loading branch information
norrland committed Nov 2, 2022
1 parent 2dd5e52 commit 84cdfdc
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions glesys/resource_glesys_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,12 @@ func resourceGlesysServerCreate(ctx context.Context, d *schema.ResourceData, m i
// Setup server parameters
srv := buildServerParamStruct(d)

if srv.Platform == "KVM" {
usersList, err := expandUsers(d.Get("user").(*schema.Set).List())
if err != nil {
return diag.Errorf("Error when expanding users: %s", err)
}
srv.Users = usersList
// Setup users for server creation
usersList, err := expandUsers(d.Get("user").(*schema.Set).List())
if err != nil {
return diag.Errorf("Error when expanding users: %s", err)
}
srv.Users = usersList

host, err := client.Servers.Create(ctx, *srv)

Expand Down

0 comments on commit 84cdfdc

Please sign in to comment.