fix primary storage maintenance on xcpng (#12694)

This commit is contained in:
Abhisar Sinha 2026-02-25 16:08:45 +05:30 committed by GitHub
parent c748b69e70
commit 744c8afcf1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 6 deletions

View File

@ -46,6 +46,10 @@ public class ModifyStoragePoolAnswer extends Answer {
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;
}

View File

@ -59,7 +59,7 @@ public final class CitrixModifyStoragePoolCommandWrapper extends CommandWrapper<
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);
@ -68,12 +68,12 @@ public final class CitrixModifyStoragePoolCommandWrapper extends CommandWrapper<
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 {
@ -85,17 +85,17 @@ public final class CitrixModifyStoragePoolCommandWrapper extends CommandWrapper<
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);
}
}
}