You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/11/03 16:32:53 UTC

[GitHub] [cloudstack] JoaoJandre commented on a diff in pull request #6348: Improving code related to the Agent properties

JoaoJandre commented on code in PR #6348:
URL: https://github.com/apache/cloudstack/pull/6348#discussion_r1013139241


##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java:
##########
@@ -1318,20 +1206,21 @@ private void enableSSLForKvmAgent(final Map<String, Object> params) {
         }
     }
 
-    protected void configureLocalStorage(final Map<String, Object> params) throws ConfigurationException {
-        String localStoragePath = (String)params.get(LOCAL_STORAGE_PATH);
-        if (localStoragePath == null) {
-            localStoragePath = DEFAULT_LOCAL_STORAGE_PATH;
-        }
-        String localStorageUUIDString = (String)params.get(LOCAL_STORAGE_UUID);
+    protected void configureLocalStorage() throws ConfigurationException {
+        String localStoragePath = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.LOCAL_STORAGE_PATH);
+        s_logger.debug(String.format("Local Storage Path set: [%s].", localStoragePath));
+
+        String localStorageUUIDString = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.LOCAL_STORAGE_UUID);
         if (localStorageUUIDString == null) {
             localStorageUUIDString = UUID.randomUUID().toString();
         }
+        s_logger.debug(String.format("Local Storage UUID set: [%s].", localStorageUUIDString));
 
         String[] localStorageRelativePaths = localStoragePath.split(CONFIG_VALUES_SEPARATOR);
         String[] localStorageUUIDStrings = localStorageUUIDString.split(CONFIG_VALUES_SEPARATOR);
         if (localStorageRelativePaths.length != localStorageUUIDStrings.length) {
-            throw new ConfigurationException("The path and UUID of local storage pools have different length");
+            s_logger.error(String.format("The path and UUID of the local storage pools have different length. Path: [%s], UUID: [%s].", localStoragePath, localStorageUUIDString));
+            throw new ConfigurationException(String.format("The path and UUID of the local storage pools have different length. Path: [%s], UUID: [%s].", localStoragePath, localStorageUUIDString));

Review Comment:
   You could create a string that holds this message, as it is being duplicated.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org