mirror of https://github.com/apache/cloudstack.git
bug 6870: during updating of pf rules, it is possible one might try to update a non existing rule via the api cmd. hitherto, we were returning a null which was assumed as a success by the cmd api, which failed with a npe. instead, we ought to throw back an error since we did not find any rule to be updated. i am checking in the same change. this also will fix the npe.
status 6870: resolved fixed
This commit is contained in:
parent
95c99a5c6e
commit
473c3d33c3
|
|
@ -3210,8 +3210,10 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
_firewallRulesDao.update(fwRule.getId(), fwRule);
|
||||
_networkMgr.updateFirewallRule(fwRule, oldPrivateIP, oldPrivatePort);
|
||||
return fwRule;
|
||||
}else{
|
||||
s_logger.warn("Unable to find the rule to be updated for public ip:public port"+publicIp+":"+publicPort+ "private ip:private port:"+privateIp+":"+privatePort);
|
||||
throw new InvalidParameterValueException("Unable to find the rule to be updated for public ip:public port"+publicIp+":"+publicPort+ " private ip:private port:"+privateIp+":"+privatePort);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue