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

[cloudstack-terraform-provider] branch main updated: Add project id for reset ssh key for VM API (#12)

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

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


The following commit(s) were added to refs/heads/main by this push:
     new b79468a  Add project id for reset ssh key for VM API (#12)
b79468a is described below

commit b79468a3db4fd3b2b0170b2a1b7ba679927bca5f
Author: Harikrishna <ha...@gmail.com>
AuthorDate: Thu Oct 28 14:14:55 2021 +0530

    Add project id for reset ssh key for VM API (#12)
---
 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 {