mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
VR: fix warning Expected X answers while executing SetXXXCommand but Y (#7050)
This commit is contained in:
parent
536a387326
commit
8838943a76
@ -40,9 +40,4 @@ public class IpAssocCommand extends NetworkElementCommand {
|
||||
public IpAddressTO[] getIpAddresses() {
|
||||
return ipAddresses;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAnswersCount() {
|
||||
return ipAddresses.length;
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,10 +29,4 @@ public class IpAssocVpcCommand extends IpAssocCommand {
|
||||
public IpAssocVpcCommand(IpAddressTO[] ips) {
|
||||
super(ips);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAnswersCount() {
|
||||
//Count private gateway to maximum value
|
||||
return ipAddresses.length * 2;
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ public abstract class NetworkElementCommand extends Command {
|
||||
}
|
||||
|
||||
public int getAnswersCount() {
|
||||
return 1;
|
||||
return 2;
|
||||
}
|
||||
|
||||
public boolean isQuery() {
|
||||
|
||||
@ -111,9 +111,4 @@ public class SetFirewallRulesCommand extends NetworkElementCommand {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAnswersCount() {
|
||||
return rules.length;
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,9 +47,4 @@ public class SetIpv6FirewallRulesCommand extends NetworkElementCommand {
|
||||
public String getGuestIp6Cidr() {
|
||||
return guestIp6Cidr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAnswersCount() {
|
||||
return rules.length;
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,4 +95,9 @@ public class SetMonitorServiceCommand extends NetworkElementCommand {
|
||||
public void setDeleteFromProcessedCache(boolean deleteFromProcessedCache) {
|
||||
this.deleteFromProcessedCache = deleteFromProcessedCache;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAnswersCount() {
|
||||
return 2 + (reconfigureAfterUpdate ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -109,9 +109,4 @@ public class SetNetworkACLCommand extends NetworkElementCommand {
|
||||
public NicTO getNic() {
|
||||
return nic;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAnswersCount() {
|
||||
return rules.length;
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,10 +40,5 @@ public class SetPortForwardingRulesCommand extends NetworkElementCommand {
|
||||
public PortForwardingRuleTO[] getRules() {
|
||||
return rules;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAnswersCount() {
|
||||
return rules.length;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -47,9 +47,4 @@ public class SetStaticNatRulesCommand extends NetworkElementCommand {
|
||||
public Long getVpcId() {
|
||||
return vpcId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAnswersCount() {
|
||||
return rules.length;
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,9 +59,4 @@ public class SetStaticRouteCommand extends NetworkElementCommand {
|
||||
}
|
||||
return toAdd.toArray(new String[toAdd.size()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAnswersCount() {
|
||||
return staticRoutes.length;
|
||||
}
|
||||
}
|
||||
|
||||
@ -286,7 +286,7 @@ public class ConfigHelperTest {
|
||||
final IpAddressTO[] ipArray = ips.toArray(new IpAddressTO[ips.size()]);
|
||||
final IpAssocVpcCommand cmd = new IpAssocVpcCommand(ipArray);
|
||||
cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME, ROUTERNAME);
|
||||
assertEquals(6, cmd.getAnswersCount()); // AnswersCount is clearly wrong as it doesn't know enough to tell
|
||||
assertEquals(2, cmd.getAnswersCount());
|
||||
|
||||
return cmd;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user