From 03e63a67e0d23e53f37711959c726b9576b2ed37 Mon Sep 17 00:00:00 2001 From: Koushik Das Date: Thu, 13 Nov 2014 14:41:33 +0530 Subject: [PATCH 1/2] CLOUDSTACK-7902: Account creation results in exception in logs Event publish code was wrapped in transaction, moved it out --- .../com/cloud/user/AccountManagerImpl.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java index 60836a51f08..3c00f91cd75 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 details, String accountUUID, final String userUUID) { + final String timezone, String accountName, final short accountType, Long domainId, final String networkDomain, final Map 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 accountGroupMap = new HashMap(); - accountGroupMap.put(accountId, new Long(accountType + 1)); - _messageBus.publish(_name, MESSAGE_ADD_ACCOUNT_EVENT, PublishScope.LOCAL, accountGroupMap); - } - return new Pair(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 accountGroupMap = new HashMap(); + 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 From d2c087aef29bac20027e0f8df27532a85f6c81b7 Mon Sep 17 00:00:00 2001 From: Phillip Kent Date: Wed, 2 Apr 2014 15:27:33 +0100 Subject: [PATCH 2/2] Update ListInternalLBVMsCmd.java Fix typo in response name string: there was an extra 's' Signed-off-by: Rajani Karuturi This closes #8 --- .../api/command/admin/internallb/ListInternalLBVMsCmd.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLBVMsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLBVMsCmd.java index 0b59b73f9d2..ba2054c3c24 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLBVMsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLBVMsCmd.java @@ -40,7 +40,7 @@ import com.cloud.vm.VirtualMachine; public class ListInternalLBVMsCmd extends BaseListProjectAndAccountResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListInternalLBVMsCmd.class.getName()); - private static final String s_name = "listinternallbvmssresponse"; + private static final String s_name = "listinternallbvmsresponse"; ///////////////////////////////////////////////////// //////////////// API parameters /////////////////////