Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C1DC518A5A for ; Sun, 31 Jan 2016 12:56:10 +0000 (UTC) Received: (qmail 70206 invoked by uid 500); 31 Jan 2016 12:56:10 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 70141 invoked by uid 500); 31 Jan 2016 12:56:10 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 70130 invoked by uid 99); 31 Jan 2016 12:56:09 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 31 Jan 2016 12:56:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C246EDFF85; Sun, 31 Jan 2016 12:56:09 +0000 (UTC) From: pedro-martins To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org References: In-Reply-To: Subject: [GitHub] cloudstack pull request: CLOUDSTACK-8931: Fail to deploy VM instan... Content-Type: text/plain Message-Id: <20160131125609.C246EDFF85@git1-us-west.apache.org> Date: Sun, 31 Jan 2016 12:56:09 +0000 (UTC) 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 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. ---