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

rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/master by this push:
     new 14bf2e9  ui: Don't pass account name when in project mode (#3435)
14bf2e9 is described below

commit 14bf2e98f362d077104b2cfe398af45d4be879fb
Author: Anurag Awasthi <anurag.awas...@shapeblue.com>
AuthorDate: Tue Jul 2 12:51:44 2019 +0530

    ui: Don't pass account name when in project mode (#3435)
    
    When users try to list instances in project mode from Account > SSHKeyPairs 
> Key > View Instances, we don't need to include sshkeypairs account name into 
the API Param. It's redundant and causes error.
    
    Fixes #2895
---
 ui/scripts/instances.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index 0a89fdc..e108788 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -750,9 +750,13 @@
                 if ("sshkeypairs" in args.context) {
                     $.extend(data, {
                         domainid: args.context.sshkeypairs[0].domainid,
-                        account: args.context.sshkeypairs[0].account,
                         keypair: args.context.sshkeypairs[0].name
                     });
+                    if (!cloudStack.context || !cloudStack.context.projects) {
+                        // In case we are in project mode sshkeypairs provides 
project account name which
+                        // should not be passed as part of API params. So only 
extend if NOT in project mode.
+                        $.extend(data, { account: 
args.context.sshkeypairs[0].account});
+                    }
                 }
 
                 $.ajax({

Reply via email to