modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml | 4 +- modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml | 8 ++-- modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml | 19 +++++----- modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java | 9 ++-- modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java | 8 ++-- 5 files changed, 27 insertions(+), 21 deletions(-)
New commits: commit cbd5dfa575bd337a9fb6007707a49f1b63a6da35 Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu Sep 26 12:35:58 2013 -0400
improve comments in generated rhq-server.properties
diff --git a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml index 41e8931..57d2012 100644 --- a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml +++ b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml @@ -793,20 +793,23 @@ rhq.sync.endpoint-address=false # not be edited. rhq.server.management.password=
-############################################# -# Cassandra cluster configuration settings -############################################# -# The username RHQ will use to authenticate against Cassandra. +# The username RHQ will use to authenticate against the Storage Cluster. +# The value is generated and should not be edited. rhq.storage.username=${rhq.storage.username}
-# The password RHQ will use to authenticate against Cassandra. +# The password RHQ will use to authenticate against the Storage Cluster. +# The value is generated and obfuscated and should not be edited. rhq.storage.password=${rhq.storage.password}
-# A comma-delimited list of storage nodes. Each Cassandra node uses this list as +############################################# +# Storage cluster configuration settings +############################################# + +# A comma-delimited list of storage nodes. Each Storage node uses this list as # contact points to find other nodes in the cluster and learn the ring # topology. The RHQ server(s) use this list to connect to the cluster; -# therefore, this property MUST BE SET in order for RHQ to talk to Cassandra. -# The of an entry is as follows, +# therefore, this property MUST BE SET in order for RHQ to talk to the Storage. +# Cluster. The of an entry is as follows: # # hostname1,hostname2 #
commit 09c7e488dcc099d890482de94e6a6098018a7e4b Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu Sep 26 12:35:08 2013 -0400
Bug 1010841 - Installation of RHQ server fails - de-obfuscating db password failed Fix in a way that won't suffer from ambiguity or db vendor incompatibilities.
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml b/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml index ebf7189..7213fc3 100644 --- a/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml +++ b/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml @@ -148,9 +148,9 @@
<data ID="62" PROPERTY_KEY="STORAGE_GOSSIP_PORT" FREAD_ONLY="TRUE"/>
- <data ID="63" PROPERTY_KEY="STORAGE_USERNAME" PROPERTY_VALUE="" DEFAULT_PROPERTY_VALUE="" FREAD_ONLY="TRUE"/> + <data ID="63" PROPERTY_KEY="STORAGE_USERNAME" PROPERTY_VALUE="UNSET" DEFAULT_PROPERTY_VALUE="UNSET" FREAD_ONLY="TRUE"/>
- <data ID="64" PROPERTY_KEY="STORAGE_PASSWORD" PROPERTY_VALUE="" DEFAULT_PROPERTY_VALUE="" FREAD_ONLY="TRUE"/> + <data ID="64" PROPERTY_KEY="STORAGE_PASSWORD" PROPERTY_VALUE="UNSET" DEFAULT_PROPERTY_VALUE="UNSET" FREAD_ONLY="TRUE"/>
</table>
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index 94688f6..713aefe 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -2263,22 +2263,22 @@ <schema-directSQL> <statement targetDBVendor="postgresql" desc="Adding storage username"> INSERT INTO rhq_system_config (id, property_key, property_value, default_property_value, fread_only) - VALUES (63, 'STORAGE_USERNAME', null, null, true) + VALUES (63, 'STORAGE_USERNAME', 'UNSET', 'UNSET', true) </statement> <statement targetDBVendor="oracle" desc="Adding storage username"> INSERT INTO rhq_system_config (id, property_key, property_value, default_property_value, fread_only) - VALUES (63, 'STORAGE_USERNAME', null, null, 1) + VALUES (63, 'STORAGE_USERNAME', 'UNSET', 'UNSET', 1) </statement> </schema-directSQL>
<schema-directSQL> <statement targetDBVendor="postgresql" desc="Adding storage password"> INSERT INTO rhq_system_config (id, property_key, property_value, default_property_value, fread_only) - VALUES (64, 'STORAGE_PASSWORD', null, null, true) + VALUES (64, 'STORAGE_PASSWORD', 'UNSET', 'UNSET', true) </statement> <statement targetDBVendor="oracle" desc="Adding default storage password"> INSERT INTO rhq_system_config (id, property_key, property_value, default_property_value, fread_only) - VALUES (64, 'STORAGE_PASSWORD', null, null, 1) + VALUES (64, 'STORAGE_PASSWORD', 'UNSET', 'UNSET', 1) </statement> </schema-directSQL> </schemaSpec> diff --git a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java index 408442a..e10c993 100644 --- a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java +++ b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java @@ -50,7 +50,6 @@ import org.rhq.core.util.obfuscation.PicketBoxObfuscator; import org.rhq.enterprise.server.installer.ServerInstallUtil.ExistingSchemaOption; import org.rhq.enterprise.server.installer.ServerInstallUtil.SupportedDatabaseType;
- /** * @author John Mazzitelli */ @@ -61,6 +60,8 @@ public class InstallerServiceImpl implements InstallerService { private static final String EAR_NAME = "rhq.ear"; private static final String SYSPROP_PROPFILE = "rhq.server.properties-file";
+ private static final String UNSET = "UNSET"; + private final Log log = LogFactory.getLog(InstallerServiceImpl.class); private final InstallerConfiguration installerConfiguration;
@@ -508,16 +509,16 @@ public class InstallerServiceImpl implements InstallerService { throw new Exception("Could not complete the database schema installation", e); }
- // if the storage cluster credentials are already set (typically an HA install), override + // if the storage cluster credentials are already set in the DB (typically an HA install), override // what's currently in the server properties file, and then continue with storage schema setup Map<String, String> storageProperties = ServerInstallUtil.fetchStorageClusterSettings(serverProperties, clearTextDbPassword); String storageUsernameSetting = storageProperties.get(ServerProperties.PROP_STORAGE_USERNAME); String storagePasswordSetting = storageProperties.get(ServerProperties.PROP_STORAGE_PASSWORD); - if (StringUtil.isNotBlank(storageUsernameSetting)) { + if (!(StringUtil.isBlank(storageUsernameSetting) || storageUsernameSetting.equals(UNSET))) { serverProperties.put(ServerProperties.PROP_STORAGE_USERNAME, storageUsernameSetting); } - if (StringUtil.isNotBlank(storagePasswordSetting)) { + if (!(StringUtil.isBlank(storagePasswordSetting) || storagePasswordSetting.equals(UNSET))) { serverProperties.put(ServerProperties.PROP_STORAGE_PASSWORD, storagePasswordSetting); }
diff --git a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java index c01ef5c..c5b66d7 100644 --- a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java +++ b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java @@ -1054,9 +1054,11 @@ public class ServerInstallUtil { connection = getDatabaseConnection(dbUrl, userName, password); connection.setAutoCommit(false);
- updateClusterSetting = connection.prepareStatement("UPDATE rhq_system_config " - + "SET property_value = ?, default_property_value = ? " - + "WHERE property_key = ? AND property_value IS NULL AND default_property_value IS NULL"); + updateClusterSetting = connection.prepareStatement("" // + + "UPDATE rhq_system_config " // + + " SET property_value = ?, default_property_value = ? " // + + " WHERE property_key = ? " // + + " AND ( property_value IS NULL OR property_value = '' OR property_value = 'UNSET' ) ");
updateClusterSetting.setString(1, serverProperties.get(ServerProperties.PROP_STORAGE_USERNAME)); updateClusterSetting.setString(2, serverProperties.get(ServerProperties.PROP_STORAGE_USERNAME));
rhq-commits@lists.fedorahosted.org