Skip to content

Commit

Permalink
simplify jdbc read-only fallback code
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Avetisyan committed Aug 1, 2017
1 parent 55af82d commit 65eac9d
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions servers/zms/src/main/java/com/yahoo/athenz/zms/ZMSImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -557,15 +557,9 @@ void loadObjectStore() {
PoolableDataSource readOnlySrc = null;
String jdbcReadOnlyStore = System.getProperty(ZMSConsts.ZMS_PROP_JDBC_RO_STORE);
if (jdbcReadOnlyStore != null && jdbcReadOnlyStore.startsWith("jdbc:")) {
String jdbcReadOnlyUser = System.getProperty(ZMSConsts.ZMS_PROP_JDBC_RO_USER);
if (jdbcReadOnlyUser == null) {
jdbcReadOnlyUser = jdbcUser;
}
password = System.getProperty(ZMSConsts.ZMS_PROP_JDBC_RO_PASSWORD, "");
String jdbcReadOnlyPassword = keyStore.getApplicationSecret(JDBC, password);
if (jdbcReadOnlyPassword == null) {
jdbcReadOnlyPassword = jdbcPassword;
}
String jdbcReadOnlyUser = System.getProperty(ZMSConsts.ZMS_PROP_JDBC_RO_USER, jdbcUser);
String readOnlyPassword = System.getProperty(ZMSConsts.ZMS_PROP_JDBC_RO_PASSWORD, password);
String jdbcReadOnlyPassword = keyStore.getApplicationSecret(JDBC, readOnlyPassword);
readOnlySrc = DataSourceFactory.create(jdbcReadOnlyStore,
jdbcReadOnlyUser, jdbcReadOnlyPassword);
}
Expand Down

0 comments on commit 65eac9d

Please sign in to comment.