From 65eac9dd484bc97e4e480ae5832c85d2e5eeb803 Mon Sep 17 00:00:00 2001 From: Henry Avetisyan Date: Tue, 1 Aug 2017 13:59:39 -0700 Subject: [PATCH] simplify jdbc read-only fallback code --- .../src/main/java/com/yahoo/athenz/zms/ZMSImpl.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/servers/zms/src/main/java/com/yahoo/athenz/zms/ZMSImpl.java b/servers/zms/src/main/java/com/yahoo/athenz/zms/ZMSImpl.java index 6657ac4d03c..66d5a1a26ae 100644 --- a/servers/zms/src/main/java/com/yahoo/athenz/zms/ZMSImpl.java +++ b/servers/zms/src/main/java/com/yahoo/athenz/zms/ZMSImpl.java @@ -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); }