Catch encoding exception

Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #464
This commit is contained in:
Rafael da Fonseca 2015-06-16 10:44:10 +02:00 committed by Daan Hoogland
parent 9f2ebdf443
commit 0851e4e54b

View File

@ -2265,7 +2265,11 @@ public class VmwareStorageProcessor implements StorageProcessor {
}
private static String deriveTemplateUuidOnHost(VmwareHypervisorHost hyperHost, String storeIdentifier, String templateName) {
String templateUuid = UUID.nameUUIDFromBytes((templateName + "@" + storeIdentifier + "-" + hyperHost.getMor().getValue()).getBytes("UTF-8")).toString();
try{
String templateUuid = UUID.nameUUIDFromBytes((templateName + "@" + storeIdentifier + "-" + hyperHost.getMor().getValue()).getBytes("UTF-8")).toString();
}catch(UnsupportedEncodingException e){
s_logger.warn("Unable to generate UUID due to unexpected encoding error."+e);
}
templateUuid = templateUuid.replaceAll("-", "");
return templateUuid;
}