You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2014/08/13 00:07:38 UTC

git commit: updated refs/heads/master to cb9319d

Repository: cloudstack
Updated Branches:
  refs/heads/master 9d776f4f2 -> cb9319d3d


bugfix CLOUDSTACK-7309 using findProjectByProjectAccountIdIncludingRemoved

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/cb9319d3
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/cb9319d3
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/cb9319d3

Branch: refs/heads/master
Commit: cb9319d3d8a1269af786986d49df6c41c69833c1
Parents: 9d776f4
Author: Luis Henrique Okama <lo...@gmail.com>
Authored: Tue Aug 12 13:29:32 2014 -0300
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Wed Aug 13 00:07:25 2014 +0200

----------------------------------------------------------------------
 server/src/com/cloud/api/ApiResponseHelper.java | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cb9319d3/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index 221e266..f4d0293 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -3010,9 +3010,11 @@ public class ApiResponseHelper implements ResponseGenerator {
         Account account = ApiDBUtils.findAccountById(usageRecord.getAccountId());
         if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) {
             //find the project
-            Project project = ApiDBUtils.findProjectByProjectAccountId(account.getId());
-            usageRecResponse.setProjectId(project.getUuid());
-            usageRecResponse.setProjectName(project.getName());
+            Project project = ApiDBUtils.findProjectByProjectAccountIdIncludingRemoved(account.getId());
+            if (project != null) {
+                usageRecResponse.setProjectId(project.getUuid());
+                usageRecResponse.setProjectName(project.getName());
+            }
         } else {
             usageRecResponse.setAccountId(account.getUuid());
             usageRecResponse.setAccountName(account.getAccountName());