You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/03/13 03:46:37 UTC

[GitHub] [cloudstack] harikrishna-patnala commented on a change in pull request #3946: server: add global configuration for default router service offering

harikrishna-patnala commented on a change in pull request #3946: server: add global configuration for default router service offering
URL: https://github.com/apache/cloudstack/pull/3946#discussion_r392017354
 
 

 ##########
 File path: server/src/main/java/org/cloud/network/router/deployment/RouterDeploymentDefinition.java
 ##########
 @@ -389,8 +390,34 @@ protected void findDefaultServiceOfferingId() {
         serviceOfferingId = serviceOffering.getId();
     }
 
+    protected void findAccountServiceOfferingId(long accountId) {
+        String accountRouterOffering = VirtualNetworkApplianceManager.VirtualRouterServiceOffering.valueIn(accountId);
+        String globalRouterOffering = VirtualNetworkApplianceManager.VirtualRouterServiceOffering.value();
+        if (accountRouterOffering != null) {
+            verifyServiceOfferingByUuid(accountRouterOffering);
+        }
+        if (serviceOfferingId == null && globalRouterOffering != accountRouterOffering) {
+            verifyServiceOfferingByUuid(globalRouterOffering);
+        }
+    }
+
+    private void verifyServiceOfferingByUuid(String offeringUuid) {
+        logger.debug("Verifying router service offering with uuid : " + offeringUuid);
+        ServiceOfferingVO serviceOffering = serviceOfferingDao.findByUuid(offeringUuid);
+        if (serviceOffering != null && serviceOffering.isSystemUse()) {
+            boolean isLocalStorage = ConfigurationManagerImpl.SystemVMUseLocalStorage.valueIn(dest.getDataCenter().getId());
+            if (isLocalStorage == serviceOffering.isUseLocalStorage()) {
+                logger.debug("service offering " + serviceOffering.getId() + " will be used on virtual router");
 
 Review comment:
   offeringUuid would be better than id in the log message. with that 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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services