You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by gi...@git.apache.org on 2017/06/21 19:53:51 UTC

[GitHub] GabrielBrascher commented on a change in pull request #2124: CLOUDSTACK-9432: cluster/host dedicated to a domain is owned by the root domain

GabrielBrascher commented on a change in pull request #2124: CLOUDSTACK-9432: cluster/host dedicated to a domain is owned by the root domain
URL: https://github.com/apache/cloudstack/pull/2124#discussion_r123349142
 
 

 ##########
 File path: server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java
 ##########
 @@ -205,6 +208,20 @@ public AffinityGroupVO doInTransaction(TransactionStatus status) {
         });
     }
 
+    /**
+     * If the account is null (domainLevel is true), then returns the domain id passed as a
+     * parameter; otherwise (domainLevel is false) it returns the domain id from the owner account.
+     *
+     * @note: this method fixes a critical bug. More details in JIRA ticket CLOUDSTACK-9432.
+     */
+    protected Long getDomainIdBasedOnDomainLevel(final Account owner, boolean domainLevel, Long domainId) {
+        Long domainIdBasedOnDomainLevel = owner.getDomainId();
+        if (domainLevel) {
+            domainIdBasedOnDomainLevel = domainId;
+        }
+        return domainIdBasedOnDomainLevel;
+    }
+
 
 Review comment:
   @rafaelweingartner thanks for the review. The code now is in a method with tests and documentation.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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