mirror of https://github.com/apache/jclouds.git
moved config dir creation to to masterscache
This commit is contained in:
parent
e915fd3e7b
commit
176a8b3b3c
|
@ -77,10 +77,6 @@ public class VirtualBoxPropertiesBuilder extends PropertiesBuilder {
|
||||||
|
|
||||||
properties.put(VIRTUALBOX_WORKINGDIR, workingDir);
|
properties.put(VIRTUALBOX_WORKINGDIR, workingDir);
|
||||||
|
|
||||||
if (!new File(workingDir).exists()) {
|
|
||||||
new File(workingDir, "isos").mkdirs();
|
|
||||||
}
|
|
||||||
|
|
||||||
String yamlDescriptor = System.getProperty("test.virtualbox.image.descriptor.yaml", VIRTUALBOX_WORKINGDIR
|
String yamlDescriptor = System.getProperty("test.virtualbox.image.descriptor.yaml", VIRTUALBOX_WORKINGDIR
|
||||||
+ File.separator + "images.yaml");
|
+ File.separator + "images.yaml");
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Named;
|
import javax.inject.Named;
|
||||||
|
@ -109,6 +110,13 @@ public class MastersCache extends AbstractLoadingCache<Image, Master> {
|
||||||
this.isoDownloader = isoDownloader;
|
this.isoDownloader = isoDownloader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void createCacheDirStructure() {
|
||||||
|
if (!new File(workingDir).exists()) {
|
||||||
|
new File(workingDir, "isos").mkdirs();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized Master get(Image key) throws ExecutionException {
|
public synchronized Master get(Image key) throws ExecutionException {
|
||||||
// check if we have loaded this machine before
|
// check if we have loaded this machine before
|
||||||
|
|
|
@ -138,10 +138,7 @@ public class BaseVirtualBoxClientLiveTest extends BaseVersionedServiceLiveTest {
|
||||||
|
|
||||||
imageId = "ubuntu-11.04-server-i386";
|
imageId = "ubuntu-11.04-server-i386";
|
||||||
isosDir = workingDir + File.separator + "isos";
|
isosDir = workingDir + File.separator + "isos";
|
||||||
File isosDirFile = new File(isosDir);
|
|
||||||
if (!isosDirFile.exists()) {
|
|
||||||
isosDirFile.mkdirs();
|
|
||||||
}
|
|
||||||
hostVersion = Iterables.get(Splitter.on('r').split(context.getProviderSpecificContext().getBuildVersion()), 0);
|
hostVersion = Iterables.get(Splitter.on('r').split(context.getProviderSpecificContext().getBuildVersion()), 0);
|
||||||
operatingSystemIso = String.format("%s/%s.iso", isosDir, imageId);
|
operatingSystemIso = String.format("%s/%s.iso", isosDir, imageId);
|
||||||
guestAdditionsIso = String.format("%s/VBoxGuestAdditions_%s.iso", isosDir, hostVersion);
|
guestAdditionsIso = String.format("%s/VBoxGuestAdditions_%s.iso", isosDir, hostVersion);
|
||||||
|
|
Loading…
Reference in New Issue