diff --git a/services/secondary-storage/server/src/main/java/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java b/services/secondary-storage/server/src/main/java/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java index af422f1ab4f..074827a9852 100644 --- a/services/secondary-storage/server/src/main/java/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java +++ b/services/secondary-storage/server/src/main/java/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java @@ -86,7 +86,6 @@ import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.io.FileUtils; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.BooleanUtils; -import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; @@ -169,6 +168,7 @@ import com.cloud.utils.EncryptionUtil; import com.cloud.utils.LogUtils; import com.cloud.utils.NumbersUtil; import com.cloud.utils.Pair; +import com.cloud.utils.StringUtils; import com.cloud.utils.SwiftUtil; import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.utils.net.NetUtils; @@ -3106,9 +3106,8 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S extraOpts.append(name + "=" + nvp.getValue() + ","); } - if (logger.isDebugEnabled()) { - logger.error("extraOpts now " + extraOpts); - } + String extraOptions = extraOpts.toString(); + logger.debug("extraOpts now ", ()->StringUtils.cleanString(extraOptions)); if (!foundUser || !foundPswd) { String errMsg = "Missing user and password from URI. Make sure they" + "are in the query string and separated by '&'. E.g. " @@ -3116,7 +3115,7 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S logger.error(errMsg); throw new CloudRuntimeException(errMsg); } - return extraOpts.toString(); + return extraOptions; } protected boolean mountExists(String localRootPath, URI uri) {