Skip to content
Closed
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 @@ -30,6 +30,7 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.io.UnsupportedEncodingException;

import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
Expand Down Expand Up @@ -680,7 +681,7 @@ private void postCreatePrivateTemplate(String installFullPath, long templateId,
// TODO a bit ugly here
BufferedWriter out = null;
try {
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(installFullPath + "/template.properties")));
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(installFullPath + "/template.properties"),"UTF-8"));
out.write("filename=" + templateName + ".ova");
out.newLine();
out.write("description=");
Expand Down Expand Up @@ -859,7 +860,7 @@ private void writeMetaOvaForTemplate(String installFullPath, String ovfFilename,
// TODO a bit ugly here
BufferedWriter out = null;
try {
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(installFullPath + "/" + templateName + ".ova.meta")));
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(installFullPath + "/" + templateName + ".ova.meta"),"UTF-8"));
out.write("ova.filename=" + templateName + ".ova");
out.newLine();
out.write("version=1.0");
Expand Down Expand Up @@ -1388,7 +1389,13 @@ private Answer attachVolume(Command cmd, DiskTO disk, boolean isAttach, boolean
}

private static String getSecondaryDatastoreUUID(String storeUrl) {
return UUID.nameUUIDFromBytes(storeUrl.getBytes()).toString();
String uuid = null;
try{
uuid=UUID.nameUUIDFromBytes(storeUrl.getBytes("UTF-8")).toString();
}catch(UnsupportedEncodingException e){
s_logger.warn("Failed to create UUID from string " + storeUrl + ". Bad storeUrl or UTF-8 encoding error." );
}
return uuid;
}

public synchronized ManagedObjectReference prepareSecondaryDatastoreOnHost(String storeUrl) throws Exception {
Expand Down