mirror of https://github.com/apache/cloudstack.git
bug 9873: create default security group for the default admin
status 9873: resolved fixed Conflicts: setup/db/create-schema.sql
This commit is contained in:
parent
550a4cda66
commit
629140af2d
|
|
@ -367,6 +367,19 @@ public class ConfigurationServerImpl implements ConfigurationServer {
|
|||
// now insert the user
|
||||
insertSql = "INSERT INTO `cloud`.`user` (id, username, password, account_id, firstname, lastname, created) " +
|
||||
"VALUES (" + id + ",'" + username + "','" + sb.toString() + "', 2, '" + firstname + "','" + lastname + "',now())";
|
||||
|
||||
|
||||
txn = Transaction.currentTxn();
|
||||
try {
|
||||
PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql);
|
||||
stmt.executeUpdate();
|
||||
} catch (SQLException ex) {
|
||||
}
|
||||
|
||||
//save default security group
|
||||
insertSql = "INSERT INTO `cloud`.`security_group` (name, description, account_id, domain_id, account_name) " +
|
||||
"VALUES ('default', 'Default Security Group', 2, 1, 'admin')";
|
||||
|
||||
|
||||
txn = Transaction.currentTxn();
|
||||
try {
|
||||
|
|
@ -864,5 +877,5 @@ public class ConfigurationServerImpl implements ConfigurationServer {
|
|||
}
|
||||
return networks.get(0).getId();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1282,6 +1282,7 @@ CREATE TABLE `cloud`.`security_group` (
|
|||
`domain_id` bigint unsigned NOT NULL,
|
||||
`account_id` bigint unsigned NOT NULL,
|
||||
`account_name` varchar(100) NOT NULL,
|
||||
UNIQUE (`name`, `account_id`),
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue