You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "rohityadavcloud (via GitHub)" <gi...@apache.org> on 2023/04/28 10:43:19 UTC

[GitHub] [cloudstack] rohityadavcloud commented on a diff in pull request #7423: ui: fix custom offering cpuspeed during vm import

rohityadavcloud commented on code in PR #7423:
URL: https://github.com/apache/cloudstack/pull/7423#discussion_r1180255893


##########
ui/src/views/tools/ImportUnmanagedInstance.vue:
##########
@@ -522,6 +523,15 @@ export default {
       }
       return 'serviceofferingdetails' in this.computeOffering ? this.computeOffering.serviceofferingdetails.maxmemory * 1 : Number.MAX_SAFE_INTEGER
     },
+    getCPUSpeed () {
+      if (!this.computeOffering) {
+        return 0
+      }
+      if (this.computeOffering.cpuspeed) {
+        return this.computeOffering.cpuspeed * 1
+      }
+      return this.resource.cpuspeed * 1 || 0

Review Comment:
   if the NaN is created from previous expression, then NaN || 0 will return 0. I think this LGTM.



-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org