cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kous...@apache.org
Subject git commit: updated refs/heads/4.5 to 03e63a6
Date Thu, 13 Nov 2014 09:36:04 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.5 8b7c1d7c5 -> 03e63a67e


CLOUDSTACK-7902: Account creation results in exception in logs
Event publish code was wrapped in transaction, moved it out


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

Branch: refs/heads/4.5
Commit: 03e63a67e0d23e53f37711959c726b9576b2ed37
Parents: 8b7c1d7
Author: Koushik Das <koushik@apache.org>
Authored: Thu Nov 13 14:41:33 2014 +0530
Committer: Koushik Das <koushik@apache.org>
Committed: Thu Nov 13 14:41:33 2014 +0530

----------------------------------------------------------------------
 .../src/com/cloud/user/AccountManagerImpl.java   | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/03e63a67/server/src/com/cloud/user/AccountManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java
index 60836a5..3c00f91 100755
--- a/server/src/com/cloud/user/AccountManagerImpl.java
+++ b/server/src/com/cloud/user/AccountManagerImpl.java
@@ -977,9 +977,8 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager,
M
         @ActionEvent(eventType = EventTypes.EVENT_USER_CREATE, eventDescription = "creating
User")
     })
     public UserAccount createUserAccount(final String userName, final String password, final
String firstName, final String lastName, final String email,
-        final String timezone, String accountName,
-        final short accountType,
-                                         Long domainId, final String networkDomain, final
Map<String, String> details, String accountUUID, final String userUUID) {
+        final String timezone, String accountName, final short accountType, Long domainId,
final String networkDomain, final Map<String, String> details,
+        String accountUUID, final String userUUID) {
 
         if (accountName == null) {
             accountName = userName;
@@ -1045,13 +1044,6 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager,
M
                     user.setRegistrationToken(registrationToken);
                 }
 
-                // create correct account and group association based on accountType
-                if (accountType != Account.ACCOUNT_TYPE_PROJECT) {
-                    Map<Long, Long> accountGroupMap = new HashMap<Long, Long>();
-                    accountGroupMap.put(accountId, new Long(accountType + 1));
-                    _messageBus.publish(_name, MESSAGE_ADD_ACCOUNT_EVENT, PublishScope.LOCAL,
accountGroupMap);
-                }
-
                 return new Pair<Long, Account>(user.getId(), account);
             }
         });
@@ -1059,6 +1051,13 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager,
M
         long userId = pair.first();
         Account account = pair.second();
 
+        // create correct account and group association based on accountType
+        if (accountType != Account.ACCOUNT_TYPE_PROJECT) {
+            Map<Long, Long> accountGroupMap = new HashMap<Long, Long>();
+            accountGroupMap.put(account.getId(), new Long(accountType + 1));
+            _messageBus.publish(_name, MESSAGE_ADD_ACCOUNT_EVENT, PublishScope.LOCAL, accountGroupMap);
+        }
+
         CallContext.current().putContextParameter(Account.class, account.getUuid());
 
         // check success


Mime
View raw message