Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bdfc439

Browse filesBrowse files
committed
CLOUDSTACK-8433: remove awsapi db usage, fix upgrade cleanup and fix packaging
- Removes awsapi db properties usage across codebase - Removes references from spring xmls, test cases and TransactionLegacy - Adds sql command to drop database cloudbridge in schema-451to460-cleanup.sql - Removes commons-logging.properties file introduced with awsapi - Fixed utils to use log4j instead of commons logging Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent e0eea01 commit bdfc439
Copy full SHA for bdfc439

File tree

Expand file treeCollapse file tree

29 files changed

+13
-226
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

29 files changed

+13
-226
lines changed
Open diff view settings
Collapse file

‎.gitignore‎

Copy file name to clipboardExpand all lines: .gitignore
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ build.number
3737
cloud.log.*.*
3838
unittest
3939
deps/cloud.userlibraries
40-
deps/awsapi-lib/
4140
.DS_Store
4241
.idea
4342
*.iml
@@ -61,14 +60,12 @@ tools/cli/build/
6160
#.*
6261

6362
target-eclipse
64-
awsapi/modules/*
6563
!.gitignore
6664
.classpath
6765
.settings.xml
6866
.settings/
6967
db.properties.override
7068
replace.properties.override
71-
awsapi/overlays/
7269
tools/marvin/marvin/cloudstackAPI/*
7370
*.egg-info/
7471
docs/tmp
Collapse file

‎README.md‎

Copy file name to clipboardExpand all lines: README.md
-1Lines changed: 0 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,4 @@ The following provides more details on the included cryptographic software:
148148
* CloudStack has a system requirement of MySQL, and uses native database encryption functionality.
149149
* CloudStack makes use of the Bouncy Castle general-purpose encryption library.
150150
* CloudStack can optionally interacts with and controls OpenSwan-based VPNs.
151-
* CloudStack has a dependency on Apache WSS4J as part of the AWSAPI implementation.
152151
* CloudStack has a dependency on and makes use of JSch - a java SSH2 implementation.
Collapse file

‎developer/pom.xml‎

Copy file name to clipboardExpand all lines: developer/pom.xml
-9Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,6 @@
131131
<argument>${basedir}/target/db/create-schema-premium.sql</argument>
132132
<!-- Seed templates -->
133133
<argument>${basedir}/target/db/templates.sql</argument>
134-
<!-- Run cloudbridge related sqls -->
135-
<argument>${basedir}/target/db/cloudbridge_schema.sql</argument>
136-
<argument>${basedir}/target/db/cloudbridge_multipart.sql</argument>
137-
<argument>${basedir}/target/db/cloudbridge_index.sql</argument>
138-
<argument>${basedir}/target/db/cloudbridge_multipart_alter.sql</argument>
139-
<argument>${basedir}/target/db/cloudbridge_bucketpolicy.sql</argument>
140-
<argument>${basedir}/target/db/cloudbridge_policy_alter.sql</argument>
141-
<argument>${basedir}/target/db/cloudbridge_offering.sql</argument>
142-
<argument>${basedir}/target/db/cloudbridge_offering_alter.sql</argument>
143134
<!-- Seed the database -->
144135
<argument>${basedir}/developer-prefill.sql</argument>
145136
<argument>${basedir}/developer-prefill.sql.override</argument>
Collapse file

‎engine/storage/snapshot/test/resources/db.properties‎

Copy file name to clipboardExpand all lines: engine/storage/snapshot/test/resources/db.properties
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ db.usage.maxIdle=30
5555
db.usage.maxWait=10000
5656
db.usage.autoReconnect=true
5757

58-
# awsapi database settings
59-
db.awsapi.name=cloudbridge
60-
6158
# Simulator database settings
6259
db.simulator.username=cloud
6360
db.simulator.password=cloud
Collapse file

‎framework/db/src/com/cloud/utils/db/TransactionLegacy.java‎

Copy file name to clipboardExpand all lines: framework/db/src/com/cloud/utils/db/TransactionLegacy.java
-38Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ public class TransactionLegacy implements Closeable {
7777

7878
public static final short CLOUD_DB = 0;
7979
public static final short USAGE_DB = 1;
80-
public static final short AWSAPI_DB = 2;
8180
public static final short SIMULATOR_DB = 3;
8281

8382
public static final short CONNECTED_DB = -1;
@@ -229,19 +228,6 @@ public static Connection getStandaloneUsageConnection() {
229228
}
230229
}
231230

232-
public static Connection getStandaloneAwsapiConnection() {
233-
try {
234-
Connection conn = s_awsapiDS.getConnection();
235-
if (s_connLogger.isTraceEnabled()) {
236-
s_connLogger.trace("Retrieving a standalone connection for usage: dbconn" + System.identityHashCode(conn));
237-
}
238-
return conn;
239-
} catch (SQLException e) {
240-
s_logger.warn("Unexpected exception: ", e);
241-
return null;
242-
}
243-
}
244-
245231
public static Connection getStandaloneSimulatorConnection() {
246232
try {
247233
Connection conn = s_simulatorDS.getConnection();
@@ -571,15 +557,6 @@ public Connection getConnection() throws SQLException {
571557
throw new CloudRuntimeException("Database is not initialized, process is dying?");
572558
}
573559
break;
574-
case AWSAPI_DB:
575-
if (s_awsapiDS != null) {
576-
_conn = s_awsapiDS.getConnection();
577-
} else {
578-
s_logger.warn("A static-initialized variable becomes null, process is dying?");
579-
throw new CloudRuntimeException("Database is not initialized, process is dying?");
580-
}
581-
break;
582-
583560
case SIMULATOR_DB:
584561
if (s_simulatorDS != null) {
585562
_conn = s_simulatorDS.getConnection();
@@ -1014,7 +991,6 @@ public String toString() {
1014991

1015992
private static DataSource s_ds;
1016993
private static DataSource s_usageDS;
1017-
private static DataSource s_awsapiDS;
1018994
private static DataSource s_simulatorDS;
1019995
private static boolean s_dbHAEnabled;
1020996

@@ -1136,20 +1112,6 @@ public static void initDataSource(Properties dbProps) {
11361112
// Data Source for usage server
11371113
s_usageDS = new PoolingDataSource(usagePoolableConnectionFactory.getPool());
11381114

1139-
// Configure awsapi db
1140-
final String awsapiDbName = dbProps.getProperty("db.awsapi.name");
1141-
final GenericObjectPool awsapiConnectionPool =
1142-
new GenericObjectPool(null, usageMaxActive, GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION, usageMaxWait, usageMaxIdle);
1143-
final ConnectionFactory awsapiConnectionFactory =
1144-
new DriverManagerConnectionFactory("jdbc:mysql://" + cloudHost + (s_dbHAEnabled ? "," + cloudSlaves : "") + ":" + cloudPort + "/" + awsapiDbName +
1145-
"?autoReconnect=" + cloudAutoReconnect + (s_dbHAEnabled ? "&" + cloudDbHAParams : "") +
1146-
(s_dbHAEnabled ? "&loadBalanceStrategy=" + loadBalanceStrategy : ""), cloudUsername, cloudPassword);
1147-
final PoolableConnectionFactory awsapiPoolableConnectionFactory =
1148-
new PoolableConnectionFactory(awsapiConnectionFactory, awsapiConnectionPool, new StackKeyedObjectPoolFactory(), null, false, false);
1149-
1150-
// Data Source for awsapi
1151-
s_awsapiDS = new PoolingDataSource(awsapiPoolableConnectionFactory.getPool());
1152-
11531115
try {
11541116
// Configure the simulator db
11551117
final int simulatorMaxActive = Integer.parseInt(dbProps.getProperty("db.simulator.maxActive"));
Collapse file

‎framework/db/test/com/cloud/utils/db/TestTransaction.java‎

Copy file name to clipboardExpand all lines: framework/db/test/com/cloud/utils/db/TestTransaction.java
-26Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -127,30 +127,4 @@ public void doInTransactionWithoutResult(TransactionStatus status) throws FileNo
127127
verify(conn, times(0)).rollback();
128128
verify(conn, times(1)).close();
129129
}
130-
131-
@Test
132-
public void testOtherdatabaseRollback() throws Exception {
133-
after();
134-
setup(TransactionLegacy.AWSAPI_DB);
135-
136-
try {
137-
Transaction.execute(new TransactionCallbackNoReturn() {
138-
@Override
139-
public void doInTransactionWithoutResult(TransactionStatus status) {
140-
assertEquals(TransactionLegacy.AWSAPI_DB, TransactionLegacy.currentTxn().getDatabaseId().shortValue());
141-
142-
throw new RuntimeException("Panic!");
143-
}
144-
});
145-
fail();
146-
} catch (RuntimeException e) {
147-
assertEquals("Panic!", e.getMessage());
148-
}
149-
150-
verify(conn).setAutoCommit(false);
151-
verify(conn, times(0)).commit();
152-
verify(conn, times(1)).rollback();
153-
verify(conn, times(1)).close();
154-
}
155-
156130
}
Collapse file

‎framework/db/test/db.properties‎

Copy file name to clipboardExpand all lines: framework/db/test/db.properties
-7Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,6 @@ db.usage.maxIdle=30
5858
db.usage.maxWait=10000
5959
db.usage.autoReconnect=true
6060

61-
# awsapi database settings
62-
db.awsapi.username=cloud
63-
db.awsapi.password=cloud
64-
db.awsapi.host=localhost
65-
db.awsapi.port=3306
66-
db.awsapi.name=cloudbridge
67-
6861
# Simulator database settings
6962
db.simulator.username=cloud
7063
db.simulator.password=cloud
Collapse file

‎framework/jobs/test/resources/db.properties‎

Copy file name to clipboardExpand all lines: framework/jobs/test/resources/db.properties
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ db.usage.maxIdle=30
5151
db.usage.maxWait=10000
5252
db.usage.autoReconnect=true
5353

54-
# awsapi database settings
55-
db.awsapi.name=cloudbridge
56-
5754
# Simulator database settings
5855
db.simulator.username=cloud
5956
db.simulator.password=cloud
Collapse file

‎packaging/centos63/cloud.spec‎

Copy file name to clipboardExpand all lines: packaging/centos63/cloud.spec
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,6 @@ fi
547547
%config(noreplace) %{_sysconfdir}/%{name}/management/web.xml
548548
%config(noreplace) %{_sysconfdir}/%{name}/management/environment.properties
549549
%config(noreplace) %{_sysconfdir}/%{name}/management/java.security.ciphers
550-
%config(noreplace) %{_sysconfdir}/%{name}/management/commons-logging.properties
551550
%attr(0755,root,root) %{_initrddir}/%{name}-management
552551
%attr(0755,root,root) %{_initrddir}/tomcat.sh
553552

Collapse file

‎packaging/centos7/cloud.spec‎

Copy file name to clipboardExpand all lines: packaging/centos7/cloud.spec
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/webapps/client/WEB-INF/cl
254254
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/webapps/client/WEB-INF/classes/vms
255255

256256
for name in catalina.properties db.properties log4j-cloud.xml web.xml \
257-
server.xml commons-logging.properties environment.properties java.security.ciphers tomcat-users.xml
257+
server.xml environment.properties java.security.ciphers tomcat-users.xml
258258
do
259259
cp packaging/centos7/tomcat7/$name \
260260
${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/$name
@@ -456,7 +456,6 @@ fi
456456
%config(noreplace) %{_sysconfdir}/%{name}/management/server.xml
457457
%config(noreplace) %{_sysconfdir}/%{name}/management/environment.properties
458458
%config(noreplace) %{_sysconfdir}/%{name}/management/java.security.ciphers
459-
%config(noreplace) %{_sysconfdir}/%{name}/management/commons-logging.properties
460459
%attr(0755,root,root) %{_unitdir}/%{name}-management.service
461460
%attr(0755,cloud,cloud) %{_localstatedir}/run/%{name}-management.pid
462461

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.