DaanHoogland commented on code in PR #7692:
URL: https://github.com/apache/cloudstack/pull/7692#discussion_r1282916756


##########
api/src/main/java/com/cloud/hypervisor/Hypervisor.java:
##########
@@ -68,7 +70,19 @@ public static enum HypervisorType {
 
         public static HypervisorType getType(String hypervisor) {
             return hypervisor == null ? HypervisorType.None :
-                    
hypervisorTypeMap.getOrDefault(hypervisor.toLowerCase(Locale.ROOT), 
HypervisorType.None);
+                    (hypervisor.toLowerCase(Locale.ROOT).equalsIgnoreCase(
+                            
HypervisorGuru.HypervisorCustomDisplayName.value()) ? Custom :
+                            
hypervisorTypeMap.getOrDefault(hypervisor.toLowerCase(Locale.ROOT), 
HypervisorType.None));
+        }
+
+        /**
+         * Returns the display name of a hypervisor type in case the custom 
hypervisor is used,
+         * using the 'hypervisor.custom.display.name' setting. Otherwise, 
returns hypervisor name
+         */
+        public static String getHypervisorDisplayName(HypervisorType 
hypervisorType) {
+            return hypervisorType != Hypervisor.HypervisorType.Custom ?
+                    hypervisorType.toString() :
+                    HypervisorGuru.HypervisorCustomDisplayName.value();

Review Comment:
   ```suggestion
           public String getHypervisorDisplayName() {
               return ! Hypervisor.HypervisorType.Custom.equals(this) ?
                       this.toString() :
                       HypervisorGuru.HypervisorCustomDisplayName.value();
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to