cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject [1/4] git commit: updated refs/heads/master to ef783d9
Date Wed, 19 Aug 2015 05:21:28 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 3006b1614 -> ef783d9b1


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/network/router/NetworkHelperImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/NetworkHelperImpl.java b/server/src/com/cloud/network/router/NetworkHelperImpl.java
index abaf54f..e096439 100644
--- a/server/src/com/cloud/network/router/NetworkHelperImpl.java
+++ b/server/src/com/cloud/network/router/NetworkHelperImpl.java
@@ -679,10 +679,10 @@ public class NetworkHelperImpl implements NetworkHelper {
             if (!routerDeploymentDefinition.isPublicNetwork()) {
                 final Nic placeholder = _networkModel.getPlaceholderNicForRouter(guestNetwork,
routerDeploymentDefinition.getPodId());
                 if (guestNetwork.getCidr() != null) {
-                    if (placeholder != null && placeholder.getIp4Address() != null)
{
-                        s_logger.debug("Requesting ipv4 address " + placeholder.getIp4Address()
+ " stored in placeholder nic for the network "
+                    if (placeholder != null && placeholder.getIPv4Address() != null)
{
+                        s_logger.debug("Requesting ipv4 address " + placeholder.getIPv4Address()
+ " stored in placeholder nic for the network "
                                 + guestNetwork);
-                        defaultNetworkStartIp = placeholder.getIp4Address();
+                        defaultNetworkStartIp = placeholder.getIPv4Address();
                     } else {
                         final String startIp = _networkModel.getStartIpAddress(guestNetwork.getId());
                         if (startIp != null
@@ -696,10 +696,10 @@ public class NetworkHelperImpl implements NetworkHelper {
                 }
 
                 if (guestNetwork.getIp6Cidr() != null) {
-                    if (placeholder != null && placeholder.getIp6Address() != null)
{
-                        s_logger.debug("Requesting ipv6 address " + placeholder.getIp6Address()
+ " stored in placeholder nic for the network "
+                    if (placeholder != null && placeholder.getIPv6Address() != null)
{
+                        s_logger.debug("Requesting ipv6 address " + placeholder.getIPv6Address()
+ " stored in placeholder nic for the network "
                                 + guestNetwork);
-                        defaultNetworkStartIpv6 = placeholder.getIp6Address();
+                        defaultNetworkStartIpv6 = placeholder.getIPv6Address();
                     } else {
                         final String startIpv6 = _networkModel.getStartIpv6Address(guestNetwork.getId());
                         if (startIpv6 != null && _ipv6Dao.findByNetworkIdAndIp(guestNetwork.getId(),
startIpv6) == null) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/network/router/RouterControlHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/RouterControlHelper.java b/server/src/com/cloud/network/router/RouterControlHelper.java
index 68fd6e3..570843d 100644
--- a/server/src/com/cloud/network/router/RouterControlHelper.java
+++ b/server/src/com/cloud/network/router/RouterControlHelper.java
@@ -49,7 +49,7 @@ public class RouterControlHelper {
         for (final NicVO n : nics) {
             final NetworkVO nc = networkDao.findById(n.getNetworkId());
             if (nc != null && nc.getTrafficType() == TrafficType.Control) {
-                routerControlIpAddress = n.getIp4Address();
+                routerControlIpAddress = n.getIPv4Address();
                 // router will have only one control ip
                 break;
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index 5ee0f57..45dd8b8 100644
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -769,10 +769,10 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine>
{
                             }
                             if (forVpc && network.getTrafficType() == TrafficType.Public
|| !forVpc && network.getTrafficType() == TrafficType.Guest
                                     && network.getGuestType() == Network.GuestType.Isolated)
{
-                                final NetworkUsageCommand usageCmd = new NetworkUsageCommand(privateIP,
router.getHostName(), forVpc, routerNic.getIp4Address());
+                                final NetworkUsageCommand usageCmd = new NetworkUsageCommand(privateIP,
router.getHostName(), forVpc, routerNic.getIPv4Address());
                                 final String routerType = router.getType().toString();
                                 final UserStatisticsVO previousStats = _userStatsDao.findBy(router.getAccountId(),
router.getDataCenterId(), network.getId(),
-                                        forVpc ? routerNic.getIp4Address() : null, router.getId(),
routerType);
+                                        forVpc ? routerNic.getIPv4Address() : null, router.getId(),
routerType);
                                 NetworkUsageAnswer answer = null;
                                 try {
                                     answer = (NetworkUsageAnswer) _agentMgr.easySend(router.getHostId(),
usageCmd);
@@ -797,7 +797,7 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine>
{
                                             @Override
                                             public void doInTransactionWithoutResult(final
TransactionStatus status) {
                                                 final UserStatisticsVO stats = _userStatsDao.lock(router.getAccountId(),
router.getDataCenterId(), network.getId(),
-                                                        forVpc ? routerNic.getIp4Address()
: null, router.getId(), routerType);
+                                                        forVpc ? routerNic.getIPv4Address()
: null, router.getId(), routerType);
                                                 if (stats == null) {
                                                     s_logger.warn("unable to find stats for
account: " + router.getAccountId());
                                                     return;
@@ -2429,10 +2429,10 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine>
{
                 // VR
                 if (forVpc && network.getTrafficType() == TrafficType.Public || !forVpc
&& network.getTrafficType() == TrafficType.Guest
                         && network.getGuestType() == Network.GuestType.Isolated)
{
-                    final NetworkUsageCommand usageCmd = new NetworkUsageCommand(privateIP,
router.getHostName(), forVpc, routerNic.getIp4Address());
+                    final NetworkUsageCommand usageCmd = new NetworkUsageCommand(privateIP,
router.getHostName(), forVpc, routerNic.getIPv4Address());
                     final String routerType = router.getType().toString();
                     final UserStatisticsVO previousStats = _userStatsDao.findBy(router.getAccountId(),
router.getDataCenterId(), network.getId(),
-                            forVpc ? routerNic.getIp4Address() : null, router.getId(), routerType);
+                            forVpc ? routerNic.getIPv4Address() : null, router.getId(), routerType);
                     NetworkUsageAnswer answer = null;
                     try {
                         answer = (NetworkUsageAnswer) _agentMgr.easySend(router.getHostId(),
usageCmd);
@@ -2458,7 +2458,7 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine>
{
                                 @Override
                                 public void doInTransactionWithoutResult(final TransactionStatus
status) {
                                     final UserStatisticsVO stats = _userStatsDao.lock(router.getAccountId(),
router.getDataCenterId(), network.getId(),
-                                            forVpc ? routerNic.getIp4Address() : null, router.getId(),
routerType);
+                                            forVpc ? routerNic.getIPv4Address() : null, router.getId(),
routerType);
                                     if (stats == null) {
                                         s_logger.warn("unable to find stats for account:
" + router.getAccountId());
                                         return;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
index 4db1adc..15d80c8 100644
--- a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
@@ -316,7 +316,7 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
                 for (final Pair<Nic, Network> nicNtwk : publicNics) {
                     final Nic publicNic = nicNtwk.first();
                     final Network publicNtwk = nicNtwk.second();
-                    final IPAddressVO userIp = _ipAddressDao.findByIpAndSourceNetworkId(publicNtwk.getId(),
publicNic.getIp4Address());
+                    final IPAddressVO userIp = _ipAddressDao.findByIpAndSourceNetworkId(publicNtwk.getId(),
publicNic.getIPv4Address());
 
                     if (userIp.isSourceNat()) {
                         final PublicIp publicIp = PublicIp.createFromAddrAndVlan(userIp,
_vlanDao.findById(userIp.getVlanId()));
@@ -324,8 +324,8 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
 
                         if (domainRouterVO.getPublicIpAddress() == null) {
                             final DomainRouterVO routerVO = _routerDao.findById(domainRouterVO.getId());
-                            routerVO.setPublicIpAddress(publicNic.getIp4Address());
-                            routerVO.setPublicNetmask(publicNic.getNetmask());
+                            routerVO.setPublicIpAddress(publicNic.getIPv4Address());
+                            routerVO.setPublicNetmask(publicNic.getIPv4Netmask());
                             routerVO.setPublicMacAddress(publicNic.getMacAddress());
                             _routerDao.update(routerVO.getId(), routerVO);
                         }
@@ -334,12 +334,12 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
                             domainRouterVO.getInstanceName(), domainRouterVO.getType());
                     cmds.addCommand(plugNicCmd);
                     final VpcVO vpc = _vpcDao.findById(domainRouterVO.getVpcId());
-                    final NetworkUsageCommand netUsageCmd = new NetworkUsageCommand(domainRouterVO.getPrivateIpAddress(),
domainRouterVO.getInstanceName(), true, publicNic.getIp4Address(), vpc.getCidr());
+                    final NetworkUsageCommand netUsageCmd = new NetworkUsageCommand(domainRouterVO.getPrivateIpAddress(),
domainRouterVO.getInstanceName(), true, publicNic.getIPv4Address(), vpc.getCidr());
                     usageCmds.add(netUsageCmd);
-                    UserStatisticsVO stats = _userStatsDao.findBy(domainRouterVO.getAccountId(),
domainRouterVO.getDataCenterId(), publicNtwk.getId(), publicNic.getIp4Address(), domainRouterVO.getId(),
+                    UserStatisticsVO stats = _userStatsDao.findBy(domainRouterVO.getAccountId(),
domainRouterVO.getDataCenterId(), publicNtwk.getId(), publicNic.getIPv4Address(), domainRouterVO.getId(),
                             domainRouterVO.getType().toString());
                     if (stats == null) {
-                        stats = new UserStatisticsVO(domainRouterVO.getAccountId(), domainRouterVO.getDataCenterId(),
publicNic.getIp4Address(), domainRouterVO.getId(), domainRouterVO.getType().toString(),
+                        stats = new UserStatisticsVO(domainRouterVO.getAccountId(), domainRouterVO.getDataCenterId(),
publicNic.getIPv4Address(), domainRouterVO.getId(), domainRouterVO.getType().toString(),
                                 publicNtwk.getId());
                         _userStatsDao.persist(stats);
                     }
@@ -365,7 +365,7 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
                     } else {
 
                         // set private network
-                        final PrivateIpVO ipVO = _privateIpDao.findByIpAndSourceNetworkId(guestNic.getNetworkId(),
guestNic.getIp4Address());
+                        final PrivateIpVO ipVO = _privateIpDao.findByIpAndSourceNetworkId(guestNic.getNetworkId(),
guestNic.getIPv4Address());
                         final Network network = _networkDao.findById(guestNic.getNetworkId());
                         BroadcastDomainType.getValue(network.getBroadcastUri());
                         final String netmask = NetUtils.getCidrNetmask(network.getCidr());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/network/rules/DhcpSubNetRules.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/rules/DhcpSubNetRules.java b/server/src/com/cloud/network/rules/DhcpSubNetRules.java
index a95ab09..a70aa81 100644
--- a/server/src/com/cloud/network/rules/DhcpSubNetRules.java
+++ b/server/src/com/cloud/network/rules/DhcpSubNetRules.java
@@ -92,7 +92,7 @@ public class DhcpSubNetRules extends RuleApplier {
         // create one.
         // This should happen only in case of Basic and Advanced SG enabled
         // networks.
-        if (!NetUtils.sameSubnet(domrGuestNic.getIp4Address(), _nic.getIPv4Address(), _nic.getIPv4Netmask()))
{
+        if (!NetUtils.sameSubnet(domrGuestNic.getIPv4Address(), _nic.getIPv4Address(), _nic.getIPv4Netmask()))
{
             final NicIpAliasDao nicIpAliasDao = visitor.getVirtualNetworkApplianceFactory().getNicIpAliasDao();
             final List<NicIpAliasVO> aliasIps = nicIpAliasDao.listByNetworkIdAndState(domrGuestNic.getNetworkId(),
NicIpAlias.state.active);
             boolean ipInVmsubnet = false;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/network/rules/RulesManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/rules/RulesManagerImpl.java b/server/src/com/cloud/network/rules/RulesManagerImpl.java
index 1ec531a..3e2b15a 100644
--- a/server/src/com/cloud/network/rules/RulesManagerImpl.java
+++ b/server/src/com/cloud/network/rules/RulesManagerImpl.java
@@ -25,11 +25,10 @@ import java.util.Set;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.api.command.user.firewall.ListPortForwardingRulesCmd;
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
+import org.apache.log4j.Logger;
 
 import com.cloud.configuration.ConfigurationManager;
 import com.cloud.domain.dao.DomainDao;
@@ -275,10 +274,10 @@ public class RulesManagerImpl extends ManagerBase implements RulesManager,
Rules
             // Verify that vm has nic in the network
             Ip dstIp = rule.getDestinationIpAddress();
             guestNic = _networkModel.getNicInNetwork(vmId, networkId);
-            if (guestNic == null || guestNic.getIp4Address() == null) {
+            if (guestNic == null || guestNic.getIPv4Address() == null) {
                 throw new InvalidParameterValueException("Vm doesn't belong to network associated
with ipAddress");
             } else {
-                dstIp = new Ip(guestNic.getIp4Address());
+                dstIp = new Ip(guestNic.getIPv4Address());
             }
 
             if (vmIp != null) {
@@ -482,7 +481,7 @@ public class RulesManagerImpl extends ManagerBase implements RulesManager,
Rules
             if (guestNic == null) {
                 throw new InvalidParameterValueException("Vm doesn't belong to the network
with specified id");
             }
-            dstIp = guestNic.getIp4Address();
+            dstIp = guestNic.getIPv4Address();
 
             if (!_networkModel.areServicesSupportedInNetwork(network.getId(), Service.StaticNat))
{
                 throw new InvalidParameterValueException("Unable to create static nat rule;
StaticNat service is not " + "supported in network with specified id");
@@ -1479,7 +1478,7 @@ public class RulesManagerImpl extends ManagerBase implements RulesManager,
Rules
         s_logger.debug("Checking if PF/StaticNat/LoadBalancer rules are configured for nic
" + nic.getId());
         List<FirewallRuleVO> result = new ArrayList<FirewallRuleVO>();
         // add PF rules
-        result.addAll(_portForwardingDao.listByNetworkAndDestIpAddr(nic.getIp4Address(),
nic.getNetworkId()));
+        result.addAll(_portForwardingDao.listByNetworkAndDestIpAddr(nic.getIPv4Address(),
nic.getNetworkId()));
         if(result.size() > 0) {
             s_logger.debug("Found " + result.size() + " portforwarding rule configured for
the nic in the network " + nic.getNetworkId());
         }
@@ -1493,7 +1492,7 @@ public class RulesManagerImpl extends ManagerBase implements RulesManager,
Rules
         }
         List<? extends IpAddress> staticNatIps = _ipAddressDao.listStaticNatPublicIps(nic.getNetworkId());
         for (IpAddress ip : staticNatIps) {
-            if (ip.getVmIp() != null && ip.getVmIp().equals(nic.getIp4Address()))
{
+            if (ip.getVmIp() != null && ip.getVmIp().equals(nic.getIPv4Address()))
{
                 VMInstanceVO vm = _vmInstanceDao.findById(nic.getInstanceId());
                 // generate a static Nat rule on the fly because staticNATrule does not persist
into db anymore
                 // FIX ME
@@ -1544,10 +1543,10 @@ public class RulesManagerImpl extends ManagerBase implements RulesManager,
Rules
         if (virtualMachineId != null) {
             // Verify that vm has nic in the network
             Nic guestNic = _networkModel.getNicInNetwork(virtualMachineId, rule.getNetworkId());
-            if (guestNic == null || guestNic.getIp4Address() == null) {
+            if (guestNic == null || guestNic.getIPv4Address() == null) {
                 throw new InvalidParameterValueException("Vm doesn't belong to network associated
with ipAddress");
             } else {
-                dstIp = new Ip(guestNic.getIp4Address());
+                dstIp = new Ip(guestNic.getIPv4Address());
             }
 
             if (vmGuestIp != null) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java b/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java
index 045c2e3..097118d 100644
--- a/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java
+++ b/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java
@@ -40,9 +40,6 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.command.user.securitygroup.AuthorizeSecurityGroupEgressCmd;
 import org.apache.cloudstack.api.command.user.securitygroup.AuthorizeSecurityGroupIngressCmd;
@@ -55,6 +52,8 @@ import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationSe
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.managed.context.ManagedContextRunnable;
 import org.apache.cloudstack.utils.identity.ManagementServerNode;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.NetworkRulesSystemVmCommand;
@@ -351,7 +350,7 @@ public class SecurityGroupManagerImpl extends ManagerBase implements SecurityGro
                     for (SecurityGroupVMMapVO ngmapVO : allowedInstances) {
                         Nic defaultNic = _networkModel.getDefaultNic(ngmapVO.getInstanceId());
                         if (defaultNic != null) {
-                            String cidr = defaultNic.getIp4Address();
+                            String cidr = defaultNic.getIPv4Address();
                             cidr = cidr + "/32";
                             cidrs.add(cidr);
                         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index a3f4b82..79e87b6 100644
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -28,20 +28,15 @@ import java.util.Map.Entry;
 import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ExecutorService;
 import java.util.concurrent.TimeUnit;
 
 import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import com.cloud.event.ActionEvent;
-import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao;
-import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO;
-import org.apache.commons.codec.binary.Base64;
-import org.apache.log4j.Logger;
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.affinity.AffinityGroupService;
@@ -91,16 +86,20 @@ import org.apache.cloudstack.storage.command.DeleteCommand;
 import org.apache.cloudstack.storage.command.DettachCommand;
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
+import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao;
+import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.Command;
 import com.cloud.agent.api.GetVmDiskStatsAnswer;
 import com.cloud.agent.api.GetVmDiskStatsCommand;
+import com.cloud.agent.api.GetVmIpAddressCommand;
 import com.cloud.agent.api.GetVmStatsAnswer;
 import com.cloud.agent.api.GetVmStatsCommand;
 import com.cloud.agent.api.PvlanSetupCommand;
-import com.cloud.agent.api.GetVmIpAddressCommand;
 import com.cloud.agent.api.StartAnswer;
 import com.cloud.agent.api.VmDiskStatsEntry;
 import com.cloud.agent.api.VmStatsEntry;
@@ -132,11 +131,12 @@ import com.cloud.deploy.DeploymentPlanner.ExcludeList;
 import com.cloud.deploy.DeploymentPlanningManager;
 import com.cloud.deploy.PlannerHostReservationVO;
 import com.cloud.deploy.dao.PlannerHostReservationDao;
-import com.cloud.domain.DomainVO;
 import com.cloud.domain.Domain;
+import com.cloud.domain.DomainVO;
 import com.cloud.domain.dao.DomainDao;
-import com.cloud.event.EventTypes;
+import com.cloud.event.ActionEvent;
 import com.cloud.event.ActionEventUtils;
+import com.cloud.event.EventTypes;
 import com.cloud.event.UsageEventUtils;
 import com.cloud.event.UsageEventVO;
 import com.cloud.event.dao.UsageEventDao;
@@ -631,7 +631,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
                 } else {
                     //previously vm has ip and nic table has ip address. After vm restart
or stop/start
                     //if vm doesnot get the ip then set the ip in nic table to null
-                    if (nic.getIp4Address() != null) {
+                    if (nic.getIPv4Address() != null) {
                         nic.setIp4Address(null);
                         _nicDao.update(nicId, nic);
                     }
@@ -1868,7 +1868,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
 
                 for (NicVO nic : nics) {
 
-                    if (nic.getIp4Address() == null) {
+                    if (nic.getIPv4Address() == null) {
                         long nicId = nic.getId();
                         long vmId = nic.getInstanceId();
                         VMInstanceVO vmInstance = _vmInstanceDao.findById(vmId);
@@ -3572,7 +3572,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
         for (NicVO nic : nics) {
             NetworkVO network = _networkDao.findById(nic.getNetworkId());
             if (network.getTrafficType() == TrafficType.Guest || network.getTrafficType()
== TrafficType.Public) {
-                userVm.setPrivateIpAddress(nic.getIp4Address());
+                userVm.setPrivateIpAddress(nic.getIPv4Address());
                 userVm.setPrivateMacAddress(nic.getMacAddress());
                 _vmDao.update(userVm.getId(), userVm);
             }
@@ -3629,7 +3629,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
             UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NETWORK_OFFERING_ASSIGN, vm.getAccountId(),
vm.getDataCenterId(), vm.getId(), Long.toString(nic.getId()),
                     network.getNetworkOfferingId(), null, isDefault, VirtualMachine.class.getName(),
vm.getUuid(), vm.isDisplay());
             if (network.getTrafficType() == TrafficType.Guest) {
-                originalIp = nic.getIp4Address();
+                originalIp = nic.getIPv4Address();
                 guestNic = nic;
                 guestNetwork = network;
                 // In vmware, we will be effecting pvlan settings in portgroups in StartCommand.
@@ -3662,7 +3662,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
             // dc.getDhcpProvider().equalsIgnoreCase(Provider.ExternalDhcpServer.getName())
             if (_ntwkSrvcDao.canProviderSupportServiceInNetwork(guestNetwork.getId(), Service.Dhcp,
Provider.ExternalDhcpServer)) {
                 _nicDao.update(guestNic.getId(), guestNic);
-                userVm.setPrivateIpAddress(guestNic.getIp4Address());
+                userVm.setPrivateIpAddress(guestNic.getIPv4Address());
                 _vmDao.update(userVm.getId(), userVm);
 
                 s_logger.info("Detected that ip changed in the answer, updated nic in the
db with new ip " + returnedIp);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/test/com/cloud/network/router/RouterControlHelperTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/network/router/RouterControlHelperTest.java b/server/test/com/cloud/network/router/RouterControlHelperTest.java
index 4117ce0..41f4c27 100644
--- a/server/test/com/cloud/network/router/RouterControlHelperTest.java
+++ b/server/test/com/cloud/network/router/RouterControlHelperTest.java
@@ -68,9 +68,9 @@ public class RouterControlHelperTest {
         NicVO nic3 = mock(NicVO.class);
         when(nic1.getNetworkId()).thenReturn(NW_ID_1);
         when(nic2.getNetworkId()).thenReturn(NW_ID_2);
-        when(nic2.getIp4Address()).thenReturn(IP4_ADDRES1);
+        when(nic2.getIPv4Address()).thenReturn(IP4_ADDRES1);
         when(nic3.getNetworkId()).thenReturn(NW_ID_3);
-        when(nic3.getIp4Address()).thenReturn(IP4_ADDRES2);
+        when(nic3.getIPv4Address()).thenReturn(IP4_ADDRES2);
         nics.add(nic1);
         nics.add(nic2);
         nics.add(nic3);
@@ -99,7 +99,7 @@ public class RouterControlHelperTest {
         List<NicVO> nics = new ArrayList<>();
         NicVO nic1 = mock(NicVO.class);
         when(nic1.getNetworkId()).thenReturn(NW_ID_1);
-        when(nic1.getIp4Address()).thenReturn(null);
+        when(nic1.getIPv4Address()).thenReturn(null);
         nics.add(nic1);
         when(this.nicDao.listByVmId(ROUTER_ID)).thenReturn(nics);
 


Mime
View raw message