Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ public ModifyStoragePoolAnswer(ModifyStoragePoolCommand cmd, long capacityBytes,
templateInfo = tInfo;
}

public ModifyStoragePoolAnswer(final Command command, final boolean success, final String details) {
super(command, success, details);
}

public void setPoolInfo(StoragePoolInfo poolInfo) {
this.poolInfo = poolInfo;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public Answer execute(final ModifyStoragePoolCommand command, final CitrixResour
if (capacity == -1) {
final String msg = "Pool capacity is -1! pool: " + pool.getHost() + pool.getPath();
logger.warn(msg);
return new Answer(command, false, msg);
return new ModifyStoragePoolAnswer(command, false, msg);
}
final Map<String, TemplateProp> tInfo = new HashMap<String, TemplateProp>();
final ModifyStoragePoolAnswer answer = new ModifyStoragePoolAnswer(command, capacity, available, tInfo);
Expand All @@ -68,12 +68,12 @@ public Answer execute(final ModifyStoragePoolCommand command, final CitrixResour
final String msg = "ModifyStoragePoolCommand add XenAPIException:" + e.toString() + " host:" + citrixResourceBase.getHost().getUuid() + " pool: " + pool.getHost()
+ pool.getPath();
logger.warn(msg, e);
return new Answer(command, false, msg);
return new ModifyStoragePoolAnswer(command, false, msg);
} catch (final Exception e) {
final String msg = "ModifyStoragePoolCommand add XenAPIException:" + e.getMessage() + " host:" + citrixResourceBase.getHost().getUuid() + " pool: "
+ pool.getHost() + pool.getPath();
logger.warn(msg, e);
return new Answer(command, false, msg);
return new ModifyStoragePoolAnswer(command, false, msg);
}
} else {
try {
Expand All @@ -85,17 +85,17 @@ public Answer execute(final ModifyStoragePoolCommand command, final CitrixResour
if (result == null || !result.split("#")[1].equals("0")) {
throw new CloudRuntimeException("Unable to remove heartbeat file entry for SR " + srUuid + " due to " + result);
}
return new Answer(command, true, "success");
return new ModifyStoragePoolAnswer(command, true, "success");
} catch (final XenAPIException e) {
final String msg = "ModifyStoragePoolCommand remove XenAPIException:" + e.toString() + " host:" + citrixResourceBase.getHost().getUuid() + " pool: "
+ pool.getHost() + pool.getPath();
logger.warn(msg, e);
return new Answer(command, false, msg);
return new ModifyStoragePoolAnswer(command, false, msg);
} catch (final Exception e) {
final String msg = "ModifyStoragePoolCommand remove XenAPIException:" + e.getMessage() + " host:" + citrixResourceBase.getHost().getUuid() + " pool: "
+ pool.getHost() + pool.getPath();
logger.warn(msg, e);
return new Answer(command, false, msg);
return new ModifyStoragePoolAnswer(command, false, msg);
}
}
}
Expand Down
Loading