bug 7616: Don't try to apply portForwardingRule when vm's nic is not set with Ip address

status 7616: resolved fixed
This commit is contained in:
alena 2010-12-27 15:50:14 -08:00
parent aa99173784
commit b7317c12fa
1 changed files with 2 additions and 2 deletions

View File

@ -158,7 +158,7 @@ public class RulesManagerImpl implements RulesManager, RulesService, Manager {
List<? extends Nic> nics = _networkMgr.getNics(vm);
for (Nic nic : nics) {
Network ntwk = _networkMgr.getNetwork(nic.getNetworkId());
if (ntwk.getGuestType() == GuestIpType.Virtual) {
if (ntwk.getGuestType() == GuestIpType.Virtual && nic.getIp4Address() != null) {
network = ntwk;
dstIp = new Ip(nic.getIp4Address());
break;
@ -166,7 +166,7 @@ public class RulesManagerImpl implements RulesManager, RulesService, Manager {
}
if (network == null) {
throw new CloudRuntimeException("Unable to find ip address to map to in " + vmId);
throw new CloudRuntimeException("Unable to find ip address to map to in vm id=" + vmId);
}
} else {
network = _networkMgr.getNetwork(rule.getNetworkId());