You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pe...@apache.org on 2021/12/29 08:14:34 UTC

[cloudstack] branch fix-list-sshkeys-proj created (now c20aa99)

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

pearl11594 pushed a change to branch fix-list-sshkeys-proj
in repository https://gitbox.apache.org/repos/asf/cloudstack.git.


      at c20aa99  API: Fix listSSHKeyPairs API when listing all resources (listall=true & projectid=-1)

This branch includes the following new commits:

     new c20aa99  API: Fix listSSHKeyPairs API when listing all resources (listall=true & projectid=-1)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[cloudstack] 01/01: API: Fix listSSHKeyPairs API when listing all resources (listall=true & projectid=-1)

Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pearl11594 pushed a commit to branch fix-list-sshkeys-proj
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit c20aa99ca4e5d375c28b32d66c1833c3f9573dd1
Author: Pearl Dsilva <pe...@gmail.com>
AuthorDate: Wed Dec 29 13:42:31 2021 +0530

    API: Fix listSSHKeyPairs API when listing all resources (listall=true & projectid=-1)
---
 framework/db/src/main/java/com/cloud/utils/db/GenericDaoBase.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/framework/db/src/main/java/com/cloud/utils/db/GenericDaoBase.java b/framework/db/src/main/java/com/cloud/utils/db/GenericDaoBase.java
index 7d1b7b7..8d69d4d 100644
--- a/framework/db/src/main/java/com/cloud/utils/db/GenericDaoBase.java
+++ b/framework/db/src/main/java/com/cloud/utils/db/GenericDaoBase.java
@@ -41,6 +41,7 @@ import java.util.Date;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.TimeZone;
 import java.util.UUID;
@@ -1293,7 +1294,8 @@ public abstract class GenericDaoBase<T, ID extends Serializable> extends Compone
             fromIndex += onClause.length();
         }
 
-        str.delete(str.length() - 4, str.length());
+        int diff =  str.toString().trim().toLowerCase(Locale.ROOT).endsWith("where") ? 6 : 4;
+        str.delete(str.length() - diff, str.length());
 
         for (JoinBuilder<SearchCriteria<?>> join : joins) {
             if (join.getT().getJoins() != null) {