Skip to content

Commit 17610a5

Browse files
author
Fabrício Duarte
committed
Merge branch 'fix-42006-accounttypes' into '4.20.0.0-scclouds'
Corrige criação das contas admin e system See merge request scclouds/scclouds!1335
2 parents b9a4538 + 39c0fb6 commit 17610a5

19 files changed

Lines changed: 22 additions & 22 deletions

api/test/integration/api/test/account/testCreateAccount.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ class AccountFactory(factory.Factory):
2929
email = factory.lazy_attribute(lambda e: '{0}.{1}@cloudstack.org'.format(e.firstname, e.lastname).lower())
3030

3131
class AdminAccountFactory(AccountFactory):
32-
accounttype = 1
32+
accounttype = 'ADMIN'
3333

3434
class UserAccountFactory(AccountFactory):
35-
accounttype = 0
35+
accounttype = 'NORMAL'
3636

3737
class TestCreateAccount(cloudstackTestCase):
3838
def setUp(self):

developer/developer-prefill.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ INSERT INTO `cloud`.`domain` (id, uuid, name, parent, path, owner) VALUES
2323

2424
-- Add system and admin accounts
2525
INSERT INTO `cloud`.`account` (id, uuid, account_name, type, domain_id, state) VALUES
26-
(1, UUID(), 'system', 1, 1, 'enabled');
26+
(1, UUID(), 'system', 'ADMIN', 1, 'enabled');
2727

2828
INSERT INTO `cloud`.`account` (id, uuid, account_name, type, domain_id, state) VALUES
29-
(2, UUID(), 'admin', 1, 1, 'enabled');
29+
(2, UUID(), 'admin', 'ADMIN', 1, 'enabled');
3030

3131
-- Add system user
3232
INSERT INTO `cloud`.`user` (id, uuid, username, password, account_id, firstname,

server/src/main/java/com/cloud/server/ConfigurationServerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ public void saveUser() {
449449
public void doInTransactionWithoutResult(TransactionStatus status) {
450450
TransactionLegacy txn = TransactionLegacy.currentTxn();
451451
// insert system account
452-
String insertSql = "INSERT INTO `cloud`.`account` (id, uuid, account_name, type, role_id, domain_id, account.default) VALUES (1, UUID(), 'system', '1', '1', '1', 1)";
452+
String insertSql = "INSERT INTO `cloud`.`account` (id, uuid, account_name, type, role_id, domain_id, account.default) VALUES (1, UUID(), 'system', 'ADMIN', '1', '1', 1)";
453453

454454
try {
455455
PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql);
@@ -477,7 +477,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) {
477477

478478
// create an account for the admin user first
479479
insertSql = "INSERT INTO `cloud`.`account` (id, uuid, account_name, type, role_id, domain_id, account.default) VALUES (" + id + ", UUID(), '" + username
480-
+ "', '1', '1', '1', 1)";
480+
+ "', 'ADMIN', '1', '1', 1)";
481481
try {
482482
PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql);
483483
stmt.executeUpdate();

test/metadata/func/directnw_regression.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ under the License.
3232
</item>
3333
<item>
3434
<name>accounttype</name>
35-
<value>1</value>
35+
<value>ADMIN</value>
3636
</item>
3737
<item>
3838
<name>domainid</name>

test/metadata/func/expunge.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ under the License.
5050
</item>
5151
<item>
5252
<name>accounttype</name>
53-
<value>1</value>
53+
<value>ADMIN</value>
5454
</item>
5555
<item>
5656
<name>domainid</name>

test/metadata/func/external_firewall.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ under the License.
2727
</item>
2828
<item>
2929
<name>accounttype</name>
30-
<value>1</value>
30+
<value>ADMIN</value>
3131
</item>
3232
<item>
3333
<name>domainid</name>

test/metadata/func/flatnetwork.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ under the License.
4242
</item>
4343
<item>
4444
<name>accounttype</name>
45-
<value>0</value>
45+
<value>NORMAL</value>
4646
</item>
4747
</parameters>
4848
<returnvalue>

test/metadata/func/loadbalancers.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ under the License.
495495
</item>
496496
<item>
497497
<name>accounttype</name>
498-
<value>0</value>
498+
<value>NORMAL</value>
499499
</item>
500500
<item>
501501
<name>domainid</name>

test/metadata/func/private_templates.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ under the License.
2828
</item>
2929
<item>
3030
<name>accounttype</name>
31-
<value>0</value>
31+
<value>NORMAL</value>
3232
</item>
3333
<item>
3434
<name>domainid</name>

test/metadata/func/regression.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ under the License.
2929
</item>
3030
<item>
3131
<name>accounttype</name>
32-
<value>1</value>
32+
<value>ADMIN</value>
3333
</item>
3434
<item>
3535
<name>domainid</name>

0 commit comments

Comments
 (0)