From 1bd0496bd0a7f68b2ff0c52ac809229458a1f34e Mon Sep 17 00:00:00 2001 From: alena Date: Tue, 26 Apr 2011 17:47:02 -0700 Subject: [PATCH] Apply nic profile to nic: don't set reservationStrategy for DB object when it's value is NULL --- server/src/com/cloud/network/NetworkManagerImpl.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java index fb24ff16589..8a6eaa917b0 100755 --- a/server/src/com/cloud/network/NetworkManagerImpl.java +++ b/server/src/com/cloud/network/NetworkManagerImpl.java @@ -993,7 +993,9 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag vo.setDeviceId(deviceId++); } - vo.setReservationStrategy(profile.getReservationStrategy()); + if (profile.getReservationStrategy() != null) { + vo.setReservationStrategy(profile.getReservationStrategy()); + } vo.setDefaultNic(profile.isDefaultNic()); @@ -1028,7 +1030,9 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag vo.setIp4Address(profile.getIp4Address()); vo.setIp6Address(profile.getIp6Address()); vo.setMacAddress(profile.getMacAddress()); - vo.setReservationStrategy(profile.getReservationStrategy()); + if (profile.getReservationStrategy() != null) { + vo.setReservationStrategy(profile.getReservationStrategy()); + } vo.setBroadcastUri(profile.getBroadCastUri()); vo.setIsolationUri(profile.getIsolationUri()); vo.setNetmask(profile.getNetmask()); @@ -1216,7 +1220,7 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag if (profile.getStrategy() != null) { nic.setReservationStrategy(profile.getStrategy()); } - + updateNic(nic, network.getId(), 1); } else { profile = new NicProfile(nic, network, nic.getBroadcastUri(), nic.getIsolationUri(), networkRate);