mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-6047: Add generic wrapper for group answer needed commands
This commit is contained in:
parent
43b414416c
commit
8b341b0639
|
|
@ -34,7 +34,7 @@ public class GroupAnswer extends Answer {
|
|||
this.results = results;
|
||||
}
|
||||
|
||||
String[] getResults() {
|
||||
public String[] getResults() {
|
||||
return results;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,4 +38,8 @@ public class IpAssocCommand extends NetworkElementCommand {
|
|||
return ipAddresses;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAnswersCount() {
|
||||
return ipAddresses.length;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,4 +26,10 @@ 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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,4 +62,8 @@ public abstract class NetworkElementCommand extends Command {
|
|||
public void setRouterAccessIp(String routerAccessIp) {
|
||||
this.routerAccessIp = routerAccessIp;
|
||||
}
|
||||
|
||||
public int getAnswersCount() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@
|
|||
// under the License.
|
||||
package com.cloud.agent.api.routing;
|
||||
|
||||
import com.cloud.agent.api.to.FirewallRuleTO;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.cloud.agent.api.to.FirewallRuleTO;
|
||||
|
||||
/**
|
||||
*
|
||||
* AccessDetails allow different components to put in information about
|
||||
|
|
@ -92,4 +92,9 @@ public class SetFirewallRulesCommand extends NetworkElementCommand {
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAnswersCount() {
|
||||
return rules.length;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,14 +17,14 @@
|
|||
|
||||
package com.cloud.agent.api.routing;
|
||||
|
||||
import com.cloud.agent.api.to.NetworkACLTO;
|
||||
import com.cloud.agent.api.to.NicTO;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.agent.api.to.NetworkACLTO;
|
||||
import com.cloud.agent.api.to.NicTO;
|
||||
|
||||
public class SetNetworkACLCommand extends NetworkElementCommand {
|
||||
NetworkACLTO[] rules;
|
||||
NicTO nic;
|
||||
|
|
@ -97,4 +97,9 @@ public class SetNetworkACLCommand extends NetworkElementCommand {
|
|||
public NicTO getNic() {
|
||||
return nic;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAnswersCount() {
|
||||
return rules.length;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@
|
|||
// under the License.
|
||||
package com.cloud.agent.api.routing;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.agent.api.to.PortForwardingRuleTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SetPortForwardingRulesCommand extends NetworkElementCommand {
|
||||
PortForwardingRuleTO[] rules;
|
||||
|
||||
|
|
@ -37,4 +37,10 @@ public class SetPortForwardingRulesCommand extends NetworkElementCommand {
|
|||
public PortForwardingRuleTO[] getRules() {
|
||||
return rules;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAnswersCount() {
|
||||
return rules.length;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@
|
|||
// under the License.
|
||||
package com.cloud.agent.api.routing;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.agent.api.to.PortForwardingRuleTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SetPortForwardingRulesVpcCommand extends SetPortForwardingRulesCommand {
|
||||
protected SetPortForwardingRulesVpcCommand() {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@
|
|||
// under the License.
|
||||
package com.cloud.agent.api.routing;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.agent.api.to.StaticNatRuleTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SetStaticNatRulesCommand extends NetworkElementCommand {
|
||||
|
||||
StaticNatRuleTO[] rules;
|
||||
|
|
@ -44,4 +44,9 @@ public class SetStaticNatRulesCommand extends NetworkElementCommand {
|
|||
public Long getVpcId() {
|
||||
return vpcId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAnswersCount() {
|
||||
return rules.length;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,14 +17,14 @@
|
|||
|
||||
package com.cloud.agent.api.routing;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.cloud.network.vpc.StaticRoute;
|
||||
import com.cloud.network.vpc.StaticRouteProfile;
|
||||
import com.cloud.utils.net.NetUtils;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class SetStaticRouteCommand extends NetworkElementCommand {
|
||||
StaticRouteProfile[] staticRoutes;
|
||||
|
||||
|
|
@ -59,4 +59,9 @@ public class SetStaticRouteCommand extends NetworkElementCommand {
|
|||
result[0] = toAdd.toArray(new String[toAdd.size()]);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAnswersCount() {
|
||||
return staticRoutes.length;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -231,14 +231,44 @@ public class VirtualRoutingResource {
|
|||
}
|
||||
}
|
||||
|
||||
private Answer applyConfigSingle(NetworkElementCommand cmd, List<ConfigItem> cfg) {
|
||||
for (ConfigItem c : cfg) {
|
||||
private Answer applyConfig(NetworkElementCommand cmd, List<ConfigItem> cfg) {
|
||||
int answersCount = cmd.getAnswersCount();
|
||||
assert (cfg.size() <= answersCount) : "Why there are more commands than answers?";
|
||||
|
||||
if (cfg.size() == 1 && answersCount == 1) {
|
||||
ConfigItem c = cfg.get(0);
|
||||
ExecutionResult result = _vrDeployer.executeInVR(cmd.getRouterAccessIp(), c.getScript(), c.getArgs());
|
||||
if (!result.isSuccess()) {
|
||||
return new Answer(cmd, false, result.getDetails());
|
||||
}
|
||||
return new Answer(cmd, result.isSuccess(), result.getDetails());
|
||||
}
|
||||
return new Answer(cmd);
|
||||
|
||||
ExecutionResult[] results = new ExecutionResult[answersCount];
|
||||
String[] resultsString = new String[answersCount];
|
||||
boolean finalResult = true;
|
||||
int i = 0, j;
|
||||
for (ConfigItem c : cfg) {
|
||||
results[i] = _vrDeployer.executeInVR(cmd.getRouterAccessIp(), c.getScript(), c.getArgs());
|
||||
if (c.getInfo() != null) {
|
||||
if (results[i].isSuccess()) {
|
||||
results[i].setDetails(c.getInfo() + " - success: " + results[i].getDetails());
|
||||
} else {
|
||||
results[i].setDetails(c.getInfo() + " - failed: " + results[i].getDetails());
|
||||
}
|
||||
}
|
||||
i ++;
|
||||
}
|
||||
i = 0; j = 0;
|
||||
while (j < answersCount) {
|
||||
resultsString[j] = results[i].getDetails();
|
||||
if (!results[i].isSuccess()) {
|
||||
finalResult = false;
|
||||
}
|
||||
// Fill the resultsString with the last result of execution, mostly in 1:n
|
||||
if (i < cfg.size() - 1) {
|
||||
i ++;
|
||||
}
|
||||
j ++;
|
||||
}
|
||||
return new GroupAnswer(cmd, finalResult, answersCount, resultsString);
|
||||
}
|
||||
|
||||
private List<ConfigItem> generateConfig(VpnUsersCfgCommand cmd) {
|
||||
|
|
@ -259,7 +289,7 @@ public class VirtualRoutingResource {
|
|||
|
||||
private Answer execute(VpnUsersCfgCommand cmd) {
|
||||
List<ConfigItem> cfg = generateConfig(cmd);
|
||||
return applyConfigSingle(cmd, cfg);
|
||||
return applyConfig(cmd, cfg);
|
||||
}
|
||||
|
||||
private List<ConfigItem> generateConfig(RemoteAccessVpnCfgCommand cmd) {
|
||||
|
|
@ -288,7 +318,7 @@ public class VirtualRoutingResource {
|
|||
|
||||
private Answer execute(RemoteAccessVpnCfgCommand cmd) {
|
||||
List<ConfigItem> cfg = generateConfig(cmd);
|
||||
return applyConfigSingle(cmd, cfg);
|
||||
return applyConfig(cmd, cfg);
|
||||
}
|
||||
|
||||
private List<ConfigItem> generateConfig(SetFirewallRulesCommand cmd) {
|
||||
|
|
@ -332,27 +362,8 @@ public class VirtualRoutingResource {
|
|||
}
|
||||
|
||||
private Answer execute(SetFirewallRulesCommand cmd) {
|
||||
int rulesCount = cmd.getRules().length;
|
||||
String[] results = new String[rulesCount];
|
||||
String routerAccessIp = cmd.getRouterAccessIp();
|
||||
|
||||
if (routerAccessIp == null) {
|
||||
return new GroupAnswer(cmd, false, rulesCount, results);
|
||||
}
|
||||
|
||||
List<ConfigItem> cfg = generateConfig(cmd);
|
||||
ConfigItem c = cfg.get(0);
|
||||
ExecutionResult result = _vrDeployer.executeInVR(routerAccessIp, c.getScript(), c.getArgs());
|
||||
|
||||
if (!result.isSuccess()) {
|
||||
//FIXME - in the future we have to process each rule separately; now we temporarily set every rule to be false if single rule fails
|
||||
for (int i = 0; i < results.length; i++) {
|
||||
results[i] = "Failed: " + result.getDetails();
|
||||
}
|
||||
return new GroupAnswer(cmd, false, rulesCount, results);
|
||||
}
|
||||
return new GroupAnswer(cmd, true, rulesCount, results);
|
||||
|
||||
return applyConfig(cmd, cfg);
|
||||
}
|
||||
|
||||
private List<ConfigItem> generateConfig(SetPortForwardingRulesCommand cmd) {
|
||||
|
|
@ -373,24 +384,8 @@ public class VirtualRoutingResource {
|
|||
}
|
||||
|
||||
private Answer execute(SetPortForwardingRulesCommand cmd) {
|
||||
int rulesCount = cmd.getRules().length;
|
||||
String[] results = new String[rulesCount];
|
||||
int i = 0;
|
||||
boolean endResult = true;
|
||||
List<ConfigItem> cfg = generateConfig(cmd);
|
||||
|
||||
for (ConfigItem c : cfg) {
|
||||
ExecutionResult result = _vrDeployer.executeInVR(cmd.getRouterAccessIp(), c.getScript(), c.getArgs());
|
||||
|
||||
if (!result.isSuccess()) {
|
||||
results[i++] = "Failed";
|
||||
endResult = false;
|
||||
} else {
|
||||
results[i++] = null;
|
||||
}
|
||||
}
|
||||
|
||||
return new GroupAnswer(cmd, endResult, rulesCount, results);
|
||||
return applyConfig(cmd, cfg);
|
||||
}
|
||||
|
||||
private List<ConfigItem> generateConfig(SetStaticNatRulesCommand cmd) {
|
||||
|
|
@ -424,24 +419,9 @@ public class VirtualRoutingResource {
|
|||
return cfg;
|
||||
}
|
||||
|
||||
private GroupAnswer execute(SetStaticNatRulesCommand cmd) {
|
||||
String[] results = new String[cmd.getRules().length];
|
||||
int i = 0;
|
||||
boolean endResult = true;
|
||||
|
||||
private Answer execute(SetStaticNatRulesCommand cmd) {
|
||||
List<ConfigItem> cfg = generateConfig(cmd);
|
||||
for (ConfigItem c : cfg) {
|
||||
ExecutionResult result = _vrDeployer.executeInVR(cmd.getRouterAccessIp(), c.getScript(), c.getArgs());
|
||||
|
||||
if (!result.isSuccess()) {
|
||||
results[i++] = "Failed";
|
||||
endResult = false;
|
||||
} else {
|
||||
results[i++] = null;
|
||||
}
|
||||
}
|
||||
|
||||
return new GroupAnswer(cmd, endResult, cmd.getRules().length, results);
|
||||
return applyConfig(cmd, cfg);
|
||||
}
|
||||
|
||||
private List<ConfigItem> generateConfig(LoadBalancerConfigCommand cmd) {
|
||||
|
|
@ -542,7 +522,7 @@ public class VirtualRoutingResource {
|
|||
|
||||
protected Answer execute(VmDataCommand cmd) {
|
||||
List<ConfigItem> cfg = generateConfig(cmd);
|
||||
return applyConfigSingle(cmd, cfg);
|
||||
return applyConfig(cmd, cfg);
|
||||
}
|
||||
|
||||
private List<ConfigItem> generateConfig(SavePasswordCommand cmd) {
|
||||
|
|
@ -560,7 +540,7 @@ public class VirtualRoutingResource {
|
|||
|
||||
protected Answer execute(final SavePasswordCommand cmd) {
|
||||
List<ConfigItem> cfg = generateConfig(cmd);
|
||||
return applyConfigSingle(cmd, cfg);
|
||||
return applyConfig(cmd, cfg);
|
||||
}
|
||||
|
||||
private List<ConfigItem> generateConfig(DhcpEntryCommand cmd) {
|
||||
|
|
@ -599,7 +579,7 @@ public class VirtualRoutingResource {
|
|||
|
||||
protected Answer execute(final DhcpEntryCommand cmd) {
|
||||
List<ConfigItem> cfg = generateConfig(cmd);
|
||||
return applyConfigSingle(cmd, cfg);
|
||||
return applyConfig(cmd, cfg);
|
||||
}
|
||||
|
||||
private List<ConfigItem> generateConfig(CreateIpAliasCommand cmd) {
|
||||
|
|
@ -617,7 +597,7 @@ public class VirtualRoutingResource {
|
|||
|
||||
protected Answer execute(final CreateIpAliasCommand cmd) {
|
||||
List<ConfigItem> cfg = generateConfig(cmd);
|
||||
return applyConfigSingle(cmd, cfg);
|
||||
return applyConfig(cmd, cfg);
|
||||
}
|
||||
|
||||
private List<ConfigItem> generateConfig(DeleteIpAliasCommand cmd) {
|
||||
|
|
@ -641,7 +621,7 @@ public class VirtualRoutingResource {
|
|||
|
||||
protected Answer execute(final DeleteIpAliasCommand cmd) {
|
||||
List<ConfigItem> cfg = generateConfig(cmd);
|
||||
return applyConfigSingle(cmd, cfg);
|
||||
return applyConfig(cmd, cfg);
|
||||
}
|
||||
|
||||
private List<ConfigItem> generateConfig(DnsMasqConfigCommand cmd) {
|
||||
|
|
@ -659,7 +639,7 @@ public class VirtualRoutingResource {
|
|||
|
||||
protected Answer execute(final DnsMasqConfigCommand cmd) {
|
||||
List<ConfigItem> cfg = generateConfig(cmd);
|
||||
return applyConfigSingle(cmd, cfg);
|
||||
return applyConfig(cmd, cfg);
|
||||
}
|
||||
|
||||
private CheckS2SVpnConnectionsAnswer execute(CheckS2SVpnConnectionsCommand cmd) {
|
||||
|
|
@ -688,7 +668,7 @@ public class VirtualRoutingResource {
|
|||
|
||||
protected Answer execute(BumpUpPriorityCommand cmd) {
|
||||
List<ConfigItem> cfg = generateConfig(cmd);
|
||||
return applyConfigSingle(cmd, cfg);
|
||||
return applyConfig(cmd, cfg);
|
||||
}
|
||||
|
||||
protected Answer execute(GetDomRVersionCmd cmd) {
|
||||
|
|
@ -754,7 +734,7 @@ public class VirtualRoutingResource {
|
|||
|
||||
protected Answer execute(Site2SiteVpnCfgCommand cmd) {
|
||||
List<ConfigItem> cfg = generateConfig(cmd);
|
||||
return applyConfigSingle(cmd, cfg);
|
||||
return applyConfig(cmd, cfg);
|
||||
}
|
||||
|
||||
protected List<ConfigItem> generateConfig(SetMonitorServiceCommand cmd) {
|
||||
|
|
@ -774,7 +754,7 @@ public class VirtualRoutingResource {
|
|||
|
||||
protected Answer execute(SetMonitorServiceCommand cmd) {
|
||||
List<ConfigItem> cfg = generateConfig(cmd);
|
||||
return applyConfigSingle(cmd, cfg);
|
||||
return applyConfig(cmd, cfg);
|
||||
}
|
||||
|
||||
protected List<ConfigItem> generateConfig(SetupGuestNetworkCommand cmd) {
|
||||
|
|
@ -819,7 +799,7 @@ public class VirtualRoutingResource {
|
|||
|
||||
protected Answer execute(SetupGuestNetworkCommand cmd) {
|
||||
List<ConfigItem> cfg = generateConfig(cmd);
|
||||
return applyConfigSingle(cmd, cfg);
|
||||
return applyConfig(cmd, cfg);
|
||||
}
|
||||
|
||||
protected List<ConfigItem> generateConfig(SetNetworkACLCommand cmd) {
|
||||
|
|
@ -856,22 +836,9 @@ public class VirtualRoutingResource {
|
|||
return cfg;
|
||||
}
|
||||
|
||||
private GroupAnswer execute(SetNetworkACLCommand cmd) {
|
||||
int rulesCount = cmd.getRules().length;
|
||||
String[] results = new String[rulesCount];
|
||||
|
||||
private Answer execute(SetNetworkACLCommand cmd) {
|
||||
List<ConfigItem> cfg = generateConfig(cmd);
|
||||
ConfigItem c = cfg.get(0);
|
||||
final ExecutionResult result = _vrDeployer.executeInVR(cmd.getRouterAccessIp(), c.getScript(), c.getArgs());
|
||||
|
||||
if (!result.isSuccess()) {
|
||||
for (int i = 0; i < results.length; i++) {
|
||||
results[i] = "Failed";
|
||||
}
|
||||
return new GroupAnswer(cmd, false, rulesCount, results);
|
||||
}
|
||||
|
||||
return new GroupAnswer(cmd, true, rulesCount, results);
|
||||
return applyConfig(cmd, cfg);
|
||||
}
|
||||
|
||||
protected List<ConfigItem> generateConfig(SetSourceNatCommand cmd) {
|
||||
|
|
@ -891,7 +858,7 @@ public class VirtualRoutingResource {
|
|||
|
||||
protected Answer execute(SetSourceNatCommand cmd) {
|
||||
List<ConfigItem> cfg = generateConfig(cmd);
|
||||
return applyConfigSingle(cmd, cfg);
|
||||
return applyConfig(cmd, cfg);
|
||||
}
|
||||
|
||||
protected List<ConfigItem> generateConfig(SetPortForwardingRulesVpcCommand cmd) {
|
||||
|
|
@ -911,45 +878,14 @@ public class VirtualRoutingResource {
|
|||
return cfg;
|
||||
}
|
||||
|
||||
private GroupAnswer execute(SetPortForwardingRulesVpcCommand cmd) {
|
||||
String[] results = new String[cmd.getRules().length];
|
||||
int i = 0;
|
||||
|
||||
boolean endResult = true;
|
||||
private Answer execute(SetPortForwardingRulesVpcCommand cmd) {
|
||||
List<ConfigItem> cfg = generateConfig(cmd);
|
||||
for (ConfigItem c : cfg) {
|
||||
ExecutionResult result = _vrDeployer.executeInVR(cmd.getRouterAccessIp(), c.getScript(), c.getArgs());
|
||||
|
||||
if (!result.isSuccess()) {
|
||||
results[i++] = "Failed";
|
||||
endResult = false;
|
||||
} else {
|
||||
results[i++] = null;
|
||||
}
|
||||
}
|
||||
return new GroupAnswer(cmd, endResult, cmd.getRules().length, results);
|
||||
return applyConfig(cmd, cfg);
|
||||
}
|
||||
|
||||
public GroupAnswer execute(IpAssocVpcCommand cmd) {
|
||||
boolean finalResult = true;
|
||||
String[] results = new String[cmd.getIpAddresses().length];
|
||||
for (int i = 0; i < cmd.getIpAddresses().length; i ++) {
|
||||
results[i] = "Failed";
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
public Answer execute(IpAssocVpcCommand cmd) {
|
||||
List<ConfigItem> cfg = generateConfig(cmd);
|
||||
for (ConfigItem c : cfg) {
|
||||
ExecutionResult result = _vrDeployer.executeInVR(cmd.getRouterAccessIp(), c.getScript(), c.getArgs());
|
||||
if (!result.isSuccess()) {
|
||||
results[i++] = c.getInfo() + " failed: " + result.getDetails();
|
||||
finalResult = false;
|
||||
break;
|
||||
}
|
||||
|
||||
results[i++] = c.getInfo() + " - success ";
|
||||
}
|
||||
return new GroupAnswer(cmd, finalResult, cmd.getIpAddresses().length, results);
|
||||
return applyConfig(cmd, cfg);
|
||||
}
|
||||
|
||||
protected List<ConfigItem> generateConfig(SetStaticRouteCommand cmd) {
|
||||
|
|
@ -969,22 +905,9 @@ public class VirtualRoutingResource {
|
|||
return cfg;
|
||||
}
|
||||
|
||||
private GroupAnswer execute(SetStaticRouteCommand cmd) {
|
||||
int rulesCount = cmd.getStaticRoutes().length;
|
||||
String[] results = new String[rulesCount];
|
||||
|
||||
private Answer execute(SetStaticRouteCommand cmd) {
|
||||
List<ConfigItem> cfg = generateConfig(cmd);
|
||||
ConfigItem c = cfg.get(0);
|
||||
final ExecutionResult result = _vrDeployer.executeInVR(cmd.getRouterAccessIp(), c.getScript(), c.getArgs());
|
||||
|
||||
if (!result.isSuccess()) {
|
||||
for (int i = 0; i < results.length; i++) {
|
||||
results[i] = "Failed";
|
||||
}
|
||||
return new GroupAnswer(cmd, false, rulesCount, results);
|
||||
}
|
||||
|
||||
return new GroupAnswer(cmd, true, rulesCount, results);
|
||||
return applyConfig(cmd, cfg);
|
||||
}
|
||||
|
||||
protected List<ConfigItem> generateConfig(IpAssocCommand cmd) {
|
||||
|
|
@ -1067,25 +990,8 @@ public class VirtualRoutingResource {
|
|||
}
|
||||
|
||||
public Answer execute(IpAssocCommand cmd) {
|
||||
boolean finalResult = true;
|
||||
String[] results = new String[cmd.getIpAddresses().length];
|
||||
for (int i = 0; i < results.length; i++) {
|
||||
results[i] = "Failed";
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
List<ConfigItem> cfg = generateConfig(cmd);
|
||||
for (ConfigItem c : cfg) {
|
||||
ExecutionResult result = _vrDeployer.executeInVR(cmd.getRouterAccessIp(), c.getScript(), c.getArgs());
|
||||
if (result.isSuccess()) {
|
||||
results[i++] = c.getInfo() + " - success";
|
||||
} else {
|
||||
results[i++] = c.getInfo() + " - failed:" + result.getDetails();
|
||||
finalResult = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new GroupAnswer(cmd, finalResult, cmd.getIpAddresses().length, results);
|
||||
return applyConfig(cmd, cfg);
|
||||
}
|
||||
|
||||
public boolean configure(final String name, final Map<String, Object> params) throws ConfigurationException {
|
||||
|
|
|
|||
Loading…
Reference in New Issue