mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +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
7f8b129dc5
commit
4bbed17d02
@ -1426,11 +1426,6 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, Manager {
|
|||||||
return null;
|
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) {
|
if (s_logger.isDebugEnabled() && answer.getDetails() != null) {
|
||||||
s_logger.debug("Details from executing " + cmd.getClass().toString() + ": " + answer.getDetails());
|
s_logger.debug("Details from executing " + cmd.getClass().toString() + ": " + answer.getDetails());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1420,12 +1420,16 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
|||||||
if (answer != null && answer.getResult()) {
|
if (answer != null && answer.getResult()) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
_storagePoolDao.expunge(pool.getId());
|
||||||
|
String msg = "";
|
||||||
if (answer != null) {
|
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 {
|
} 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