You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ha...@apache.org on 2021/10/28 06:47:07 UTC

[cloudstack-terraform-provider] 01/01: Add project id for reset ssh key for VM API

This is an automated email from the ASF dual-hosted git repository.

harikrishna pushed a commit to branch FixProjectIDforResetSSHKey
in repository https://gitbox.apache.org/repos/asf/cloudstack-terraform-provider.git

commit efce8dd3a497fad760a97ce9bb34ce03828ddb9b
Author: Harikrishna Patnala <ha...@gmail.com>
AuthorDate: Thu Oct 28 12:16:04 2021 +0530

    Add project id for reset ssh key for VM API
---
 cloudstack/resource_cloudstack_instance.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/cloudstack/resource_cloudstack_instance.go b/cloudstack/resource_cloudstack_instance.go
index c860628..8922606 100644
--- a/cloudstack/resource_cloudstack_instance.go
+++ b/cloudstack/resource_cloudstack_instance.go
@@ -572,6 +572,10 @@ func resourceCloudStackInstanceUpdate(d *schema.ResourceData, meta interface{})
 
 			p := cs.SSH.NewResetSSHKeyForVirtualMachineParams(d.Id(), d.Get("keypair").(string))
 
+			// If there is a project supplied, we retrieve and set the project id
+			if err := setProjectid(p, cs, d); err != nil {
+				return err
+			}
 			// Change the ssh keypair
 			_, err = cs.SSH.ResetSSHKeyForVirtualMachine(p)
 			if err != nil {