Return-Path: X-Original-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9201EE247 for ; Mon, 11 Feb 2013 19:49:07 +0000 (UTC) Received: (qmail 51277 invoked by uid 500); 11 Feb 2013 19:49:01 -0000 Delivered-To: apmail-incubator-cloudstack-commits-archive@incubator.apache.org Received: (qmail 51210 invoked by uid 500); 11 Feb 2013 19:49:00 -0000 Mailing-List: contact cloudstack-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-commits@incubator.apache.org Received: (qmail 50629 invoked by uid 99); 11 Feb 2013 19:49:00 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Feb 2013 19:49:00 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id E315B3CC02; Mon, 11 Feb 2013 19:48:59 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bfederle@apache.org To: cloudstack-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [10/29] git commit: refs/heads/ui-plugins - CLOUDSTACK-1216: insert UUID when we create "admin" user in DB. Message-Id: <20130211194859.E315B3CC02@tyr.zones.apache.org> Date: Mon, 11 Feb 2013 19:48:59 +0000 (UTC) CLOUDSTACK-1216: insert UUID when we create "admin" user in DB. Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/1cf85aa8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/1cf85aa8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/1cf85aa8 Branch: refs/heads/ui-plugins Commit: 1cf85aa87aee205470590534f9e9f3996eb6df7c Parents: a92968c Author: Min Chen Authored: Fri Feb 8 14:15:15 2013 -0800 Committer: Min Chen Committed: Fri Feb 8 14:18:31 2013 -0800 ---------------------------------------------------------------------- .../com/cloud/server/ConfigurationServerImpl.java | 16 +++++++------- 1 files changed, 8 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1cf85aa8/server/src/com/cloud/server/ConfigurationServerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/server/ConfigurationServerImpl.java b/server/src/com/cloud/server/ConfigurationServerImpl.java index 5fa4c60..6bf7f95 100755 --- a/server/src/com/cloud/server/ConfigurationServerImpl.java +++ b/server/src/com/cloud/server/ConfigurationServerImpl.java @@ -123,7 +123,7 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio @Inject private NetworkOfferingDao _networkOfferingDao; @Inject private DataCenterDao _dataCenterDao; @Inject private NetworkDao _networkDao; - @Inject private VlanDao _vlanDao; + @Inject private VlanDao _vlanDao; private String _domainSuffix; @Inject private DomainDao _domainDao; @Inject private AccountDao _accountDao; @@ -135,11 +135,11 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio public ConfigurationServerImpl() { setRunLevel(ComponentLifecycle.RUN_LEVEL_FRAMEWORK_BOOTSTRAP); } - + @Override public boolean configure(String name, Map params) throws ConfigurationException { - + try { persistDefaultValues(); } catch (InternalErrorException e) { @@ -235,7 +235,7 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio createDefaultNetworks(); createDefaultRegion(); - + // Create userIpAddress ranges // Update existing vlans with networkId @@ -374,8 +374,8 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio } // now insert the user - insertSql = "INSERT INTO `cloud`.`user` (id, username, password, account_id, firstname, lastname, created, state, region_id) " + - "VALUES (" + id + ",'" + username + "', RAND(), 2, '" + firstname + "','" + lastname + "',now(), 'disabled', '1')"; + insertSql = "INSERT INTO `cloud`.`user` (id, uuid, username, password, account_id, firstname, lastname, created, state, region_id) " + + "VALUES (" + id + ", UUID(), '" + username + "', RAND(), 2, '" + firstname + "','" + lastname + "',now(), 'disabled', '1')"; txn = Transaction.currentTxn(); try { @@ -1271,9 +1271,9 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio return svcProviders; } - + private void createDefaultRegion(){ - //Get Region name and URL from db.properties + //Get Region name and URL from db.properties _regionDao.persist(new RegionVO(_regionDao.getRegionId(), "Local", "http://localhost:8080/client/api", "", "")); }