Skip to content

Commit 88d32c7

Browse files
committed
fix return value
1 parent b836fc4 commit 88d32c7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,8 @@ public String updateConfiguration(final long userId, final String name, final St
678678
// if scope is mentioned as global or not mentioned then it is normal
679679
// global parameter updation
680680
if (scope != null && !scope.isEmpty() && !ConfigKey.Scope.Global.toString().equalsIgnoreCase(scope)) {
681-
if (shouldEncryptValue(category)) {
681+
boolean valueEncrypted = shouldEncryptValue(category);
682+
if (valueEncrypted) {
682683
value = DBEncryptionUtil.encrypt(value);
683684
}
684685

@@ -772,7 +773,8 @@ public String updateConfiguration(final long userId, final String name, final St
772773
default:
773774
throw new InvalidParameterValueException("Scope provided is invalid");
774775
}
775-
return DBEncryptionUtil.decrypt(value);
776+
777+
return valueEncrypted ? DBEncryptionUtil.decrypt(value) : value;
776778
}
777779

778780
// Execute all updates in a single transaction

0 commit comments

Comments
 (0)