Skip to content

Commit 9a6e134

Browse files
committed
Fix network guest types support
1 parent f991b2b commit 9a6e134

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/guru/NiciraNvpGuestNetworkGuru.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,23 @@ public NiciraNvpGuestNetworkGuru() {
113113
protected boolean canHandle(final NetworkOffering offering, final NetworkType networkType, final PhysicalNetwork physicalNetwork) {
114114
// This guru handles only Guest Isolated network that supports Source nat service
115115
if (networkType == NetworkType.Advanced && isMyTrafficType(offering.getTrafficType())
116-
&& (offering.getGuestType() == Network.GuestType.Isolated || offering.getGuestType() == Network.GuestType.Shared)
116+
&& supportedGuestTypes(offering, Network.GuestType.Isolated, Network.GuestType.Shared)
117117
&& isMyIsolationMethod(physicalNetwork) && ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), Service.Connectivity)) {
118118
return true;
119119
} else {
120120
return false;
121121
}
122122
}
123123

124+
private boolean supportedGuestTypes(NetworkOffering offering, GuestType... types) {
125+
for (GuestType guestType : types) {
126+
if (offering.getGuestType().equals(guestType)){
127+
return true;
128+
}
129+
}
130+
return false;
131+
}
132+
124133
@Override
125134
public Network design(final NetworkOffering offering, final DeploymentPlan plan, final Network userSpecified, final Account owner) {
126135
// Check of the isolation type of the related physical network is supported

0 commit comments

Comments
 (0)