SWIFT: add error handling code

add swift plugin for XenServer 6.0
This commit is contained in:
anthony 2011-12-14 13:42:00 -08:00
parent c66897e329
commit 331bd6c103
2 changed files with 13 additions and 3 deletions

View File

@ -3300,6 +3300,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
protected String callHostPlugin(Connection conn, String plugin, String cmd, String... params) {
Map<String, String> args = new HashMap<String, String>();
String msg;
try {
for (int i = 0; i < params.length; i += 2) {
args.put(params[i], params[i + 1]);
@ -3315,11 +3316,13 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
}
return result.replace("\n", "");
} catch (XenAPIException e) {
s_logger.warn("callHostPlugin failed for cmd: " + cmd + " with args " + getArgsString(args) + " due to " + e.toString());
msg = "callHostPlugin failed for cmd: " + cmd + " with args " + getArgsString(args) + " due to " + e.toString();
s_logger.warn(msg);
} catch (XmlRpcException e) {
s_logger.debug("callHostPlugin failed for cmd: " + cmd + " with args " + getArgsString(args) + " due to " + e.getMessage());
msg = "callHostPlugin failed for cmd: " + cmd + " with args " + getArgsString(args) + " due to " + e.getMessage();
s_logger.debug(msg);
}
return null;
throw new CloudRuntimeException(msg);
}
protected String getArgsString(Map<String, String> args) {

View File

@ -43,3 +43,10 @@ vhd-util=..,0755,/opt/xensource/bin
vmopspremium=..,0755,/etc/xapi.d/plugins
create_privatetemplate_from_snapshot.sh=..,0755,/opt/xensource/bin
upgrade_snapshot.sh=..,0755,/opt/xensource/bin
cloud-clean-vlan.sh=..,0755,/opt/xensource/bin
cloud-prepare-upgrade.sh=..,0755,/opt/xensource/bin
getRouterStatus.sh=../../../../network/domr/,0755,/opt/xensource/bin
bumpUpPriority.sh=../../../../network/domr/,0755,/opt/xensource/bin
getDomRVersion.sh=../../../../network/domr/,0755,/opt/xensource/bin
swift=..,0755,/opt/xensource/bin
swiftxen=..,0755,/etc/xapi.d/plugins