Apply nic profile to nic: don't set reservationStrategy for DB object when it's value is NULL

This commit is contained in:
alena 2011-04-26 17:47:02 -07:00
parent 584718ceb6
commit 508fef2269
1 changed files with 7 additions and 3 deletions

View File

@ -996,7 +996,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());
@ -1031,7 +1033,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());
@ -1218,7 +1222,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);