Skip to content

Commit 508fef2

Browse files
committed
Apply nic profile to nic: don't set reservationStrategy for DB object when it's value is NULL
1 parent 584718c commit 508fef2

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎server/src/com/cloud/network/NetworkManagerImpl.java‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,9 @@ protected Integer applyProfileToNic(NicVO vo, NicProfile profile, Integer device
996996
vo.setDeviceId(deviceId++);
997997
}
998998

999-
vo.setReservationStrategy(profile.getReservationStrategy());
999+
if (profile.getReservationStrategy() != null) {
1000+
vo.setReservationStrategy(profile.getReservationStrategy());
1001+
}
10001002

10011003
vo.setDefaultNic(profile.isDefaultNic());
10021004

@@ -1031,7 +1033,9 @@ protected void applyProfileToNicForRelease(NicVO vo, NicProfile profile) {
10311033
vo.setIp4Address(profile.getIp4Address());
10321034
vo.setIp6Address(profile.getIp6Address());
10331035
vo.setMacAddress(profile.getMacAddress());
1034-
vo.setReservationStrategy(profile.getReservationStrategy());
1036+
if (profile.getReservationStrategy() != null) {
1037+
vo.setReservationStrategy(profile.getReservationStrategy());
1038+
}
10351039
vo.setBroadcastUri(profile.getBroadCastUri());
10361040
vo.setIsolationUri(profile.getIsolationUri());
10371041
vo.setNetmask(profile.getNetmask());
@@ -1218,7 +1222,7 @@ public int compare(NicVO nic1, NicVO nic2) {
12181222
if (profile.getStrategy() != null) {
12191223
nic.setReservationStrategy(profile.getStrategy());
12201224
}
1221-
1225+
12221226
updateNic(nic, network.getId(), 1);
12231227
} else {
12241228
profile = new NicProfile(nic, network, nic.getBroadcastUri(), nic.getIsolationUri(), networkRate);

0 commit comments

Comments
 (0)