weizhouapache 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_r392563747
 
 

 ##########
 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) {
 
 Review comment:
   > @weizhouapache `if (serviceOffering != null)`, which should be always, 
`globalRouterOffering` will not be checked, whether or not 
`globalRouterOffering` == `accountRouterOffering`.
   > so I don't think your 3 and 4 are correct but this condition will never be 
met and `verifyServiceOfferingByUuid(globalRouterOffering)` will never be 
executed.
   > So, why check for `serviceOfferingId` before `globalRouterOffering` when 
it is the last resort and is only relevant after `globalRouterOffering`?
   
   @DaanHoogland it is serviceOfferingId , not serviceOffering.
   
   
https://github.com/apache/cloudstack/blob/3783a092a9431e64f6cf11fc7a1056b338f4f7ab/server/src/main/java/org/cloud/network/router/deployment/RouterDeploymentDefinition.java#L109
   
   
   the check procedure
   
   
https://github.com/apache/cloudstack/blob/3783a092a9431e64f6cf11fc7a1056b338f4f7ab/server/src/main/java/org/cloud/network/router/deployment/RouterDeploymentDefinition.java#L416-L424
   
   
   in the account part, considering the uuid might be invalid, so check account 
setting at first, then global setting if account setting is invalid. (if 
account setting is not set, accountRouterOffering is actually the global 
setting, so skip the check if accountRouterOffering equals to 
globalRouterOffering )
   
   
https://github.com/apache/cloudstack/blob/3783a092a9431e64f6cf11fc7a1056b338f4f7ab/server/src/main/java/org/cloud/network/router/deployment/RouterDeploymentDefinition.java#L393-L414
   
   
   hope it helps you understanding all changes in PR. 
   
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to