Skip to content

Commit dec53f7

Browse files
Pearl1594DaanHoogland
authored andcommitted
Allow modification of user vm details if user.vm.readonly.details is empty
1 parent 25f93b1 commit dec53f7

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
@@ -1006,7 +1006,7 @@ public Configuration updateConfiguration(final UpdateCfgCmd cmd) throws InvalidP
10061006
value = value.trim();
10071007

10081008
if (value.isEmpty() || value.equals("null")) {
1009-
value = (id == null) ? null : "";
1009+
value = (id == null && !name.equals("user.vm.readonly.details")) ? null : "";
10101010
}
10111011

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

0 commit comments

Comments
 (0)