Skip to content

Commit

Permalink
made password optional to allow for clc to generate password. query c…
Browse files Browse the repository at this point in the history
…lc for credentials when reading server state
  • Loading branch information
tonycapone committed Apr 29, 2016
1 parent 0238925 commit 5376ba3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion builtin/providers/clc/resource_clc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ func resourceCLCServer() *schema.Resource {
},
"password": &schema.Schema{
Type: schema.TypeString,
Required: true,
Optional: true,
Computed: true,
Default: nil,
},
// optional
"description": &schema.Schema{
Expand Down Expand Up @@ -183,6 +185,8 @@ func resourceCLCServerRead(d *schema.ResourceData, meta interface{}) error {
d.Set("public_ip_address", s.Details.IPaddresses[0].Public)
}
}
p, err := client.Server.GetCredentials(d.Id())
d.Set("password", p.Password)

d.Set("name", s.Name)
d.Set("groupId", s.GroupID)
Expand All @@ -195,6 +199,7 @@ func resourceCLCServerRead(d *schema.ResourceData, meta interface{}) error {
d.Set("storage_type", s.Storagetype)
d.Set("created_date", s.ChangeInfo.CreatedDate)
d.Set("modified_date", s.ChangeInfo.ModifiedDate)

return nil
}

Expand Down

0 comments on commit 5376ba3

Please sign in to comment.