mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-17 11:04:00 +01:00
correct checking answer
This commit is contained in:
parent
386d4a540d
commit
be174f7f36
@ -1531,7 +1531,7 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory,
|
|||||||
Long dcId = host.getDataCenterId();
|
Long dcId = host.getDataCenterId();
|
||||||
ReadyCommand ready = new ReadyCommand(dcId);
|
ReadyCommand ready = new ReadyCommand(dcId);
|
||||||
Answer answer = easySend(hostId, ready);
|
Answer answer = easySend(hostId, ready);
|
||||||
if (answer == null) {
|
if (answer == null || !answer.getResult()) {
|
||||||
// this is tricky part for secondary storage
|
// this is tricky part for secondary storage
|
||||||
// make it as disconnected, wait for secondary storage VM to be up
|
// make it as disconnected, wait for secondary storage VM to be up
|
||||||
// return the attache instead of null, even it is disconnectede
|
// return the attache instead of null, even it is disconnectede
|
||||||
|
|||||||
@ -91,7 +91,7 @@ public class AgentBasedConsoleProxyManager implements ConsoleProxyManager, Virtu
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
GetVncPortAnswer answer = (GetVncPortAnswer) _agentMgr.easySend(vm.getHostId(), new GetVncPortCommand(vm.getId(), vm.getName()));
|
GetVncPortAnswer answer = (GetVncPortAnswer) _agentMgr.easySend(vm.getHostId(), new GetVncPortCommand(vm.getId(), vm.getName()));
|
||||||
return answer == null ? -1 : answer.getPort();
|
return (answer == null || !answer.getResult()) ? -1 : answer.getPort();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -2729,7 +2729,7 @@ public class ManagementServerImpl implements ManagementServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
GetVncPortAnswer answer = (GetVncPortAnswer) _agentMgr.easySend(vm.getHostId(), new GetVncPortCommand(vm.getId(), vm.getInstanceName()));
|
GetVncPortAnswer answer = (GetVncPortAnswer) _agentMgr.easySend(vm.getHostId(), new GetVncPortCommand(vm.getId(), vm.getInstanceName()));
|
||||||
if(answer != null) {
|
if(answer != null && answer.getResult()) {
|
||||||
return new Pair<String, Integer>(answer.getAddress(), answer.getPort());
|
return new Pair<String, Integer>(answer.getAddress(), answer.getPort());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1477,11 +1477,9 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
|||||||
DeleteStoragePoolCommand cmd = new DeleteStoragePoolCommand(sPool);
|
DeleteStoragePoolCommand cmd = new DeleteStoragePoolCommand(sPool);
|
||||||
final Answer answer = _agentMgr.easySend(host.getHostId(), cmd);
|
final Answer answer = _agentMgr.easySend(host.getHostId(), cmd);
|
||||||
|
|
||||||
if (answer != null) {
|
if (answer != null && answer.getResult()) {
|
||||||
if (answer.getResult() == true) {
|
deleteFlag = true;
|
||||||
deleteFlag = true;
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -315,7 +315,7 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
|
|||||||
setupCmd.setCopyPassword(copyPasswd);
|
setupCmd.setCopyPassword(copyPasswd);
|
||||||
setupCmd.setCopyUserName(TemplateConstants.DEFAULT_HTTP_AUTH_USER);
|
setupCmd.setCopyUserName(TemplateConstants.DEFAULT_HTTP_AUTH_USER);
|
||||||
Answer answer = _agentMgr.easySend(storageHost.getId(), setupCmd);
|
Answer answer = _agentMgr.easySend(storageHost.getId(), setupCmd);
|
||||||
if (answer != null) {
|
if (answer != null && answer.getResult()) {
|
||||||
if (s_logger.isDebugEnabled()) {
|
if (s_logger.isDebugEnabled()) {
|
||||||
s_logger.debug("Successfully programmed http auth into " + secStorageVm.getName());
|
s_logger.debug("Successfully programmed http auth into " + secStorageVm.getName());
|
||||||
}
|
}
|
||||||
@ -359,7 +359,7 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Answer answer = _agentMgr.easySend(storageHost.getId(), cpc);
|
Answer answer = _agentMgr.easySend(storageHost.getId(), cpc);
|
||||||
if (answer != null) {
|
if (answer != null && answer.getResult()) {
|
||||||
if (s_logger.isDebugEnabled()) {
|
if (s_logger.isDebugEnabled()) {
|
||||||
s_logger.debug("Successfully programmed firewall rules into " + secStorageVm.getName());
|
s_logger.debug("Successfully programmed firewall rules into " + secStorageVm.getName());
|
||||||
}
|
}
|
||||||
@ -1083,7 +1083,7 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
|
|||||||
final RebootCommand cmd = new RebootCommand(secStorageVm.getInstanceName());
|
final RebootCommand cmd = new RebootCommand(secStorageVm.getInstanceName());
|
||||||
final Answer answer = _agentMgr.easySend(secStorageVm.getHostId(), cmd);
|
final Answer answer = _agentMgr.easySend(secStorageVm.getHostId(), cmd);
|
||||||
|
|
||||||
if (answer != null) {
|
if (answer != null && answer.getResult()) {
|
||||||
if (s_logger.isDebugEnabled()) {
|
if (s_logger.isDebugEnabled()) {
|
||||||
s_logger.debug("Successfully reboot secondary storage vm " + secStorageVm.getName());
|
s_logger.debug("Successfully reboot secondary storage vm " + secStorageVm.getName());
|
||||||
}
|
}
|
||||||
@ -1274,7 +1274,7 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
|
|||||||
|
|
||||||
MigrateCommand cmd = new MigrateCommand(secStorageVm.getInstanceName(), host.getPrivateIpAddress(), false);
|
MigrateCommand cmd = new MigrateCommand(secStorageVm.getInstanceName(), host.getPrivateIpAddress(), false);
|
||||||
Answer answer = _agentMgr.easySend(fromHost.getId(), cmd);
|
Answer answer = _agentMgr.easySend(fromHost.getId(), cmd);
|
||||||
if (answer == null) {
|
if (answer == null || !answer.getResult()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user