incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [6/8] git commit: refs/heads/master - ApiServer: Get rid of finding system account and user at init() time
Date Sat, 16 Feb 2013 12:19:47 GMT
ApiServer: Get rid of finding system account and user at init() time

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>


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

Branch: refs/heads/master
Commit: 8094e933b08d830822dbdc711e5caad3c067b5d7
Parents: 295b327
Author: Rohit Yadav <bhaisaab@apache.org>
Authored: Sat Feb 16 17:09:37 2013 +0530
Committer: Rohit Yadav <bhaisaab@apache.org>
Committed: Sat Feb 16 17:09:37 2013 +0530

----------------------------------------------------------------------
 server/src/com/cloud/api/ApiServer.java |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/8094e933/server/src/com/cloud/api/ApiServer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiServer.java b/server/src/com/cloud/api/ApiServer.java
index be02f5e..0ef84c2 100755
--- a/server/src/com/cloud/api/ApiServer.java
+++ b/server/src/com/cloud/api/ApiServer.java
@@ -157,8 +157,6 @@ public class ApiServer implements HttpRequestHandler {
     @Inject List<PluggableService> _pluggableServices;
     @Inject List<APIChecker> _apiAccessCheckers;
 
-    private Account _systemAccount = null;
-    private User _systemUser = null;
     @Inject private RegionManager _regionMgr = null;
     
     private static int _workerCount = 0;
@@ -182,9 +180,6 @@ public class ApiServer implements HttpRequestHandler {
     }
 
     public void init() {
-        _systemAccount = _accountMgr.getSystemAccount();
-        _systemUser = _accountMgr.getSystemUser();
-
         Integer apiPort = null; // api port, null by default
         SearchCriteria<ConfigurationVO> sc = _configDao.createSearchCriteria();
         sc.addAnd("name", SearchCriteria.Op.EQ, "integration.api.port");
@@ -278,7 +273,7 @@ public class ApiServer implements HttpRequestHandler {
 
             try {
                 // always trust commands from API port, user context will always be UID_SYSTEM/ACCOUNT_ID_SYSTEM
-                UserContext.registerContext(_systemUser.getId(), _systemAccount, null, true);
+                UserContext.registerContext(_accountMgr.getSystemUser().getId(), _accountMgr.getSystemAccount(),
null, true);
                 sb.insert(0, "(userId=" + User.UID_SYSTEM + " accountId=" + Account.ACCOUNT_ID_SYSTEM
+ " sessionId=" + null + ") ");
                 String responseText = handleRequest(parameterMap, responseType, sb);
                 sb.append(" 200 " + ((responseText == null) ? 0 : responseText.length()));


Mime
View raw message