mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
1. return message to UI if adding primary storage failed
2. delete primary storage entry if if adding primary storage failed
This commit is contained in:
parent
be38384e76
commit
62249f3eae
@ -1423,11 +1423,6 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, Manager {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!answer.getResult()) {
|
||||
s_logger.warn("Unable to execute command: " + cmd.toString() + " due to " + answer.getDetails());
|
||||
return null;
|
||||
}
|
||||
|
||||
if (s_logger.isDebugEnabled() && answer.getDetails() != null) {
|
||||
s_logger.debug("Details from executing " + cmd.getClass().toString() + ": " + answer.getDetails());
|
||||
}
|
||||
|
||||
@ -1408,12 +1408,16 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
||||
if (answer != null && answer.getResult()) {
|
||||
return true;
|
||||
} else {
|
||||
_storagePoolDao.expunge(pool.getId());
|
||||
String msg = "";
|
||||
if (answer != null) {
|
||||
s_logger.warn(" can not create strorage pool through host " + hostId + " due to " + answer.getDetails());
|
||||
msg = "Can not create strorage pool through host " + hostId + " due to " + answer.getDetails();
|
||||
s_logger.warn(msg);
|
||||
} else {
|
||||
s_logger.warn(" can not create strorage pool through host " + hostId + " due to CreateStoragePoolCommand returns null");
|
||||
msg = "Can not create strorage pool through host " + hostId + " due to CreateStoragePoolCommand returns null";
|
||||
s_logger.warn(msg);
|
||||
}
|
||||
return false;
|
||||
throw new CloudRuntimeException(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user