Skip to content

Commit 744c8af

Browse files
authored
fix primary storage maintenance on xcpng (#12694)
1 parent c748b69 commit 744c8af

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

core/src/main/java/com/cloud/agent/api/ModifyStoragePoolAnswer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ public ModifyStoragePoolAnswer(ModifyStoragePoolCommand cmd, long capacityBytes,
4646
templateInfo = tInfo;
4747
}
4848

49+
public ModifyStoragePoolAnswer(final Command command, final boolean success, final String details) {
50+
super(command, success, details);
51+
}
52+
4953
public void setPoolInfo(StoragePoolInfo poolInfo) {
5054
this.poolInfo = poolInfo;
5155
}

plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/wrapper/xenbase/CitrixModifyStoragePoolCommandWrapper.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public Answer execute(final ModifyStoragePoolCommand command, final CitrixResour
5959
if (capacity == -1) {
6060
final String msg = "Pool capacity is -1! pool: " + pool.getHost() + pool.getPath();
6161
logger.warn(msg);
62-
return new Answer(command, false, msg);
62+
return new ModifyStoragePoolAnswer(command, false, msg);
6363
}
6464
final Map<String, TemplateProp> tInfo = new HashMap<String, TemplateProp>();
6565
final ModifyStoragePoolAnswer answer = new ModifyStoragePoolAnswer(command, capacity, available, tInfo);
@@ -68,12 +68,12 @@ public Answer execute(final ModifyStoragePoolCommand command, final CitrixResour
6868
final String msg = "ModifyStoragePoolCommand add XenAPIException:" + e.toString() + " host:" + citrixResourceBase.getHost().getUuid() + " pool: " + pool.getHost()
6969
+ pool.getPath();
7070
logger.warn(msg, e);
71-
return new Answer(command, false, msg);
71+
return new ModifyStoragePoolAnswer(command, false, msg);
7272
} catch (final Exception e) {
7373
final String msg = "ModifyStoragePoolCommand add XenAPIException:" + e.getMessage() + " host:" + citrixResourceBase.getHost().getUuid() + " pool: "
7474
+ pool.getHost() + pool.getPath();
7575
logger.warn(msg, e);
76-
return new Answer(command, false, msg);
76+
return new ModifyStoragePoolAnswer(command, false, msg);
7777
}
7878
} else {
7979
try {
@@ -85,17 +85,17 @@ public Answer execute(final ModifyStoragePoolCommand command, final CitrixResour
8585
if (result == null || !result.split("#")[1].equals("0")) {
8686
throw new CloudRuntimeException("Unable to remove heartbeat file entry for SR " + srUuid + " due to " + result);
8787
}
88-
return new Answer(command, true, "success");
88+
return new ModifyStoragePoolAnswer(command, true, "success");
8989
} catch (final XenAPIException e) {
9090
final String msg = "ModifyStoragePoolCommand remove XenAPIException:" + e.toString() + " host:" + citrixResourceBase.getHost().getUuid() + " pool: "
9191
+ pool.getHost() + pool.getPath();
9292
logger.warn(msg, e);
93-
return new Answer(command, false, msg);
93+
return new ModifyStoragePoolAnswer(command, false, msg);
9494
} catch (final Exception e) {
9595
final String msg = "ModifyStoragePoolCommand remove XenAPIException:" + e.getMessage() + " host:" + citrixResourceBase.getHost().getUuid() + " pool: "
9696
+ pool.getHost() + pool.getPath();
9797
logger.warn(msg, e);
98-
return new Answer(command, false, msg);
98+
return new ModifyStoragePoolAnswer(command, false, msg);
9999
}
100100
}
101101
}

0 commit comments

Comments
 (0)