You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2023/11/16 10:38:00 UTC

(cloudstack) branch main updated: Improved concatenation way in PropertiesStorage.java (#7486)

This is an automated email from the ASF dual-hosted git repository.

dahn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/main by this push:
     new cc45bffdbd3 Improved concatenation way in PropertiesStorage.java (#7486)
cc45bffdbd3 is described below

commit cc45bffdbd35f0d8021b917fd4233972cc481dc6
Author: maheshnikam <55...@users.noreply.github.com>
AuthorDate: Thu Nov 16 16:07:53 2023 +0530

    Improved concatenation way in PropertiesStorage.java (#7486)
    
    Co-authored-by: dahn <da...@gmail.com>
    Co-authored-by: Daniel Augusto Veronezi Salvador <38...@users.noreply.github.com>
---
 .../src/main/java/com/cloud/agent/dao/impl/PropertiesStorage.java  | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/agent/src/main/java/com/cloud/agent/dao/impl/PropertiesStorage.java b/agent/src/main/java/com/cloud/agent/dao/impl/PropertiesStorage.java
index a1db88c86c4..87610c29f34 100644
--- a/agent/src/main/java/com/cloud/agent/dao/impl/PropertiesStorage.java
+++ b/agent/src/main/java/com/cloud/agent/dao/impl/PropertiesStorage.java
@@ -92,11 +92,14 @@ public class PropertiesStorage implements StorageComponent {
             file = new File(path);
             try {
                 if (!file.createNewFile()) {
-                    s_logger.error("Unable to create _file: " + file.getAbsolutePath());
+                    s_logger.error(String.format("Unable to create _file: %s", file.getAbsolutePath()));
                     return false;
                 }
             } catch (IOException e) {
-                s_logger.error("Unable to create _file: " + file.getAbsolutePath(), e);
+                s_logger.error(String.format("Unable to create file: %s", file.getAbsolutePath()));
+                if (s_logger.isDebugEnabled()) {
+                    s_logger.debug(String.format("IOException while trying to create file: %s", file.getAbsolutePath()), e);
+                }
                 return false;
             }
         }