Skip to content

Commit a970680

Browse files
committed
Allow modification of user vm details if user.vm.readonly.details is empty
1 parent c1bc57b commit a970680

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

engine/schema/src/main/resources/META-INF/db/schema-420to421.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,3 +242,6 @@ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'manag
242242
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.hung.wokervm.timeout', '7200', 'Worker VM timeout in seconds');
243243
INSERT IGNORE INTO `cloud`.`configuration` VALUES ("Alert", 'DEFAULT', 'management-server', "alert.smtp.connectiontimeout", "30000", "Socket connection timeout value in milliseconds. -1 for infinite timeout.");
244244
INSERT IGNORE INTO `cloud`.`configuration` VALUES ("Alert", 'DEFAULT', 'management-server', "alert.smtp.timeout", "30000", "Socket I/O timeout value in milliseconds. -1 for infinite timeout.");
245+
246+
-- Update the value of user.vm.readonly.details record in the configuration table to "" if it is NULL
247+
UPDATE `cloud`.`configuration` SET value = '' WHERE name = 'user.vm.readonly.details' AND value IS NULL;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ public Configuration updateConfiguration(final UpdateCfgCmd cmd) throws InvalidP
995995
value = value.trim();
996996

997997
if (value.isEmpty() || value.equals("null")) {
998-
value = (id == null) ? null : "";
998+
value = (id == null && !name.equals("user.vm.readonly.details")) ? null : "";
999999
}
10001000

10011001
final String updatedValue = updateConfiguration(userId, name, category, value, scope, id);

0 commit comments

Comments
 (0)