mirror of https://github.com/apache/cloudstack.git
Cloudstack-3299 incorrect arguments sent to the script createIpalias in case of vmware, Cloudstack-3240 corrected a mistake in the script name.
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
This commit is contained in:
parent
54c2133590
commit
160c8f361b
|
|
@ -2026,36 +2026,36 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
|
|||
|
||||
protected Answer execute(final CreateIpAliasCommand cmd) {
|
||||
if (s_logger.isInfoEnabled()) {
|
||||
s_logger.info("Executing createipAlias command: " + _gson.toJson(cmd));
|
||||
s_logger.info("Executing createIpAlias command: " + _gson.toJson(cmd));
|
||||
}
|
||||
String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
|
||||
List<IpAliasTO> ipAliasTOs = cmd.getIpAliasList();
|
||||
String args=routerIp+" ";
|
||||
String args="";
|
||||
for (IpAliasTO ipaliasto : ipAliasTOs) {
|
||||
args = args + ipaliasto.getAlias_count()+":"+ipaliasto.getRouterip()+":"+ipaliasto.getNetmask()+"-";
|
||||
}
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Run command on domR " + cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP) + ", /root/createipAlias " + args);
|
||||
s_logger.debug("Run command on domR " + cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP) + ", /root/createIpAlias " + args);
|
||||
}
|
||||
|
||||
try {
|
||||
VmwareManager mgr = getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
|
||||
String controlIp = getRouterSshControlIp(cmd);
|
||||
Pair<Boolean, String> result = SshHelper.sshExecute(controlIp, DEFAULT_DOMR_SSHPORT, "root", mgr.getSystemVMKeyFile(), null,
|
||||
"/root/createipAlias.sh " + args);
|
||||
"/root/createIpAlias.sh " + args);
|
||||
|
||||
if (!result.first()) {
|
||||
s_logger.error("ipAlias command on domr " + controlIp + " failed, message: " + result.second());
|
||||
s_logger.error("CreateIpAlias command on domr " + controlIp + " failed, message: " + result.second());
|
||||
|
||||
return new Answer(cmd, false, "createipAlias failed due to " + result.second());
|
||||
}
|
||||
|
||||
if (s_logger.isInfoEnabled()) {
|
||||
s_logger.info("createipAlias command on domain router " + controlIp + " completed");
|
||||
s_logger.info("createIpAlias command on domain router " + controlIp + " completed");
|
||||
}
|
||||
|
||||
} catch (Throwable e) {
|
||||
String msg = "createipAlias failed due to " + VmwareHelper.getExceptionMessage(e);
|
||||
String msg = "createIpAlias failed due to " + VmwareHelper.getExceptionMessage(e);
|
||||
s_logger.error(msg, e);
|
||||
return new Answer(cmd, false, msg);
|
||||
}
|
||||
|
|
@ -2068,9 +2068,9 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
|
|||
List<IpAliasTO> revokedIpAliasTOs = cmd.getDeleteIpAliasTos();
|
||||
List<IpAliasTO> activeIpAliasTOs = cmd.getCreateIpAliasTos();
|
||||
if (s_logger.isInfoEnabled()) {
|
||||
s_logger.info("Executing deleteipAlias command: " + _gson.toJson(cmd));
|
||||
s_logger.info("Executing deleteIpAlias command: " + _gson.toJson(cmd));
|
||||
}
|
||||
String args=routerIp+" ";
|
||||
String args="";
|
||||
for (IpAliasTO ipAliasTO : revokedIpAliasTOs) {
|
||||
args = args + ipAliasTO.getAlias_count()+":"+ipAliasTO.getRouterip()+":"+ipAliasTO.getNetmask()+"-";
|
||||
}
|
||||
|
|
@ -2079,27 +2079,27 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
|
|||
args = args + ipAliasTO.getAlias_count()+":"+ipAliasTO.getRouterip()+":"+ipAliasTO.getNetmask()+"-";
|
||||
}
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Run command on domR " + cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP) + ", /root/deleteipAlias " + args);
|
||||
s_logger.debug("Run command on domR " + cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP) + ", /root/deleteIpAlias " + args);
|
||||
}
|
||||
|
||||
try {
|
||||
VmwareManager mgr = getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
|
||||
String controlIp = getRouterSshControlIp(cmd);
|
||||
Pair<Boolean, String> result = SshHelper.sshExecute(controlIp, DEFAULT_DOMR_SSHPORT, "root", mgr.getSystemVMKeyFile(), null,
|
||||
"/root/deleteipAlias.sh " + args);
|
||||
"/root/deleteIpAlias.sh " + args);
|
||||
|
||||
if (!result.first()) {
|
||||
s_logger.error("ipAlias command on domr " + controlIp + " failed, message: " + result.second());
|
||||
s_logger.error("deleteIpAlias command on domr " + controlIp + " failed, message: " + result.second());
|
||||
|
||||
return new Answer(cmd, false, "deleteipAlias failed due to " + result.second());
|
||||
return new Answer(cmd, false, "deleteIpAlias failed due to " + result.second());
|
||||
}
|
||||
|
||||
if (s_logger.isInfoEnabled()) {
|
||||
s_logger.info("deleteipAlias command on domain router " + controlIp + " completed");
|
||||
s_logger.info("deleteIpAlias command on domain router " + controlIp + " completed");
|
||||
}
|
||||
|
||||
} catch (Throwable e) {
|
||||
String msg = "deleteipAlias failed due to " + VmwareHelper.getExceptionMessage(e);
|
||||
String msg = "deleteIpAlias failed due to " + VmwareHelper.getExceptionMessage(e);
|
||||
s_logger.error(msg, e);
|
||||
return new Answer(cmd, false, msg);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue