From ae8df820fb0931a706e3e2c2dae72781cb98d882 Mon Sep 17 00:00:00 2001 From: Prachi Damle Date: Wed, 16 Jan 2013 17:22:02 -0800 Subject: [PATCH] https://issues.apache.org/jira/browse/CLOUDSTACK-993 Changes: - Introduction of maven skipped the java code that inserts the admin user. This causes the NPE in management server while trying to find the user and also, admin user cannot login as expected. - Fixing the insertion of the admin user as part of startup. Conflicts: server/src/com/cloud/server/ConfigurationServerImpl.java --- server/src/com/cloud/server/ConfigurationServerImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/server/ConfigurationServerImpl.java b/server/src/com/cloud/server/ConfigurationServerImpl.java index c0c29ed8eb8..55121861a50 100755 --- a/server/src/com/cloud/server/ConfigurationServerImpl.java +++ b/server/src/com/cloud/server/ConfigurationServerImpl.java @@ -341,8 +341,8 @@ public class ConfigurationServerImpl implements ConfigurationServer { } // now insert the user - insertSql = "INSERT INTO `cloud`.`user` (id, username, account_id, firstname, lastname, created, state) " + - "VALUES (" + id + ",'" + username + "', 2, '" + firstname + "','" + lastname + "',now(), 'disabled')"; + insertSql = "INSERT INTO `cloud`.`user` (id, username, password, account_id, firstname, lastname, created, state) " + + "VALUES (" + id + ",'" + username + "', RAND(), 2, '" + firstname + "','" + lastname + "',now(), 'disabled')"; txn = Transaction.currentTxn(); try {