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/master to f585dd2
Date Thu, 13 Nov 2014 10:42:24 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 8c9093b1d -> f585dd266


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/f585dd26
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f585dd26
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f585dd26

Branch: refs/heads/master
Commit: f585dd266188a134a9c8b911376b066b9d3806e8
Parents: 8c9093b
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 16:11:53 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/f585dd26/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