You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by pedro-martins <gi...@git.apache.org> on 2016/01/31 13:56:09 UTC

[GitHub] cloudstack pull request: CLOUDSTACK-8931: Fail to deploy VM instan...

Github user pedro-martins commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/907#discussion_r51360120
  
    --- Diff: server/src/com/cloud/network/IpAddressManagerImpl.java ---
    @@ -680,10 +681,14 @@ public IPAddressVO doInTransaction(TransactionStatus status) throws Insufficient
     
             // If owner has dedicated Public IP ranges, fetch IP from the dedicated range
             // Otherwise fetch IP from the system pool
    -        List<AccountVlanMapVO> maps = _accountVlanMapDao.listAccountVlanMapsByAccount(owner.getId());
    -        for (AccountVlanMapVO map : maps) {
    -            if (vlanDbIds == null || vlanDbIds.contains(map.getVlanDbId()))
    -                dedicatedVlanDbIds.add(map.getVlanDbId());
    +        Network network = _networksDao.findById(guestNetworkId);
    +        //Checking if network is null in the case of system VM's. At the time of allocation of IP address to systemVm, no network is present.
    +        if(network == null || !(network.getGuestType() == GuestType.Shared && zone.getNetworkType() == NetworkType.Advanced)) {
    --- End diff --
    
    Hi, kansal.
    Could you extract this 'if' content to a method with a little test case and a Javadoc? 
    You had explained this 'if' pretty good in the comment above, but I think that is a little confuse to understand yet, I know that you can explain this if better and use a Javadoc to do it.
    
    Ty.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---