Skip to content

Commit 95ed15e

Browse files
committedSep 18, 2020
ovh_me_ssh_key: fix setting key default property
It was mistakenly implemented, so rather than passing parameters to the function, parameters gets passed to response struct. Signed-off-by: Mateusz Gozdek <[email protected]>
1 parent 88960ff commit 95ed15e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed
 

‎ovh/resource_ovh_me_ssh_key.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ func resourceMeSshKeyCreate(d *schema.ResourceData, meta interface{}) error {
110110
}
111111
err = config.OVHClient.Put(
112112
fmt.Sprintf("/me/sshKey/%s", keyName),
113-
nil,
114113
putParams,
114+
nil,
115115
)
116116
if err != nil {
117117
return fmt.Errorf("Unable to update SSH key named %s:\n\t %q", keyName, err)
@@ -129,8 +129,8 @@ func resourceMeSshKeyUpdate(d *schema.ResourceData, meta interface{}) error {
129129
}
130130
err := config.OVHClient.Put(
131131
fmt.Sprintf("/me/sshKey/%s", keyName),
132-
nil,
133132
params,
133+
nil,
134134
)
135135
if err != nil {
136136
return fmt.Errorf("Unable to update SSH key named %s:\n\t %q", keyName, err)

‎ovh/resource_ovh_me_ssh_key_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ func TestAccMeSshKey_basic(t *testing.T) {
7373
"ovh_me_ssh_key.key_1", "key_name", sshKeyName),
7474
resource.TestCheckResourceAttr(
7575
"ovh_me_ssh_key.key_1", "key", sshKey),
76+
resource.TestCheckResourceAttr(
77+
"ovh_me_ssh_key.key_1", "default", "true"),
7678
),
7779
},
7880
{
@@ -96,5 +98,6 @@ const testAccMeSshKeyConfig = `
9698
resource "ovh_me_ssh_key" "key_1" {
9799
key_name = "%s"
98100
key = "%s"
101+
default = true
99102
}
100103
`

0 commit comments

Comments
 (0)
Please sign in to comment.