mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
agent: Set default values for all variables
This commit is contained in:
parent
c4f847518f
commit
9fe611037f
@ -412,6 +412,14 @@ public class LibvirtComputingResource extends ServerResourceBase implements
|
||||
return "scripts/storage/qcow2";
|
||||
}
|
||||
|
||||
protected String getDefaultKvmScriptsDir() {
|
||||
return "scripts/vm/hypervisor/kvm";
|
||||
}
|
||||
|
||||
protected String getDefaultDomrScriptsDir() {
|
||||
return "scripts/network/domr/kvm";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean configure(String name, Map<String, Object> params)
|
||||
throws ConfigurationException {
|
||||
@ -430,16 +438,15 @@ public class LibvirtComputingResource extends ServerResourceBase implements
|
||||
+ "com.cloud.storage.JavaStorageLayer");
|
||||
}
|
||||
|
||||
_virtRouterResource = new VirtualRoutingResource();
|
||||
|
||||
// Set the domr scripts directory
|
||||
params.put("domr.scripts.dir", "scripts/network/domr/kvm");
|
||||
|
||||
success = _virtRouterResource.configure(name, params);
|
||||
String domrScriptsDir = (String) params.get("domr.scripts.dir");
|
||||
if (domrScriptsDir == null) {
|
||||
domrScriptsDir = getDefaultDomrScriptsDir();
|
||||
}
|
||||
|
||||
String kvmScriptsDir = (String) params.get("kvm.scripts.dir");
|
||||
if (kvmScriptsDir == null) {
|
||||
kvmScriptsDir = "scripts/vm/hypervisor/kvm";
|
||||
kvmScriptsDir = getDefaultKvmScriptsDir();
|
||||
}
|
||||
|
||||
String networkScriptsDir = (String) params.get("network.scripts.dir");
|
||||
@ -452,6 +459,11 @@ public class LibvirtComputingResource extends ServerResourceBase implements
|
||||
storageScriptsDir = getDefaultStorageScriptsDir();
|
||||
}
|
||||
|
||||
params.put("domr.scripts.dir", domrScriptsDir);
|
||||
|
||||
_virtRouterResource = new VirtualRoutingResource();
|
||||
success = _virtRouterResource.configure(name, params);
|
||||
|
||||
if (!success) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user