Merge pull request #991 from shapeblue/allow-pluggable-kvmresource-master

[master/4.6] CLOUDSTACK-8999: Don't override resource if provided by agent.propertiesIf a custom resource (kvm/libvirt implementation) is defined in agent.properties
don't override with the default, but check and fallback to the default if
resource property not defined

A simple if-else fix, cc @remibergsma @wido @wilderrodrigues @borisroman and others

* pr/991:
  CLOUDSTACK-8999: Don't override resource if provided by agent.properties

Signed-off-by: Remi Bergsma <github@remi.nl>
This commit is contained in:
Remi Bergsma 2015-10-28 19:20:39 +01:00
commit da9063e7df
1 changed files with 2 additions and 1 deletions

View File

@ -678,7 +678,8 @@ class cloudAgentConfig(serviceCfgBase):
cfo.addEntry("guid", str(self.syscfg.env.uuid))
if cfo.getEntry("local.storage.uuid") == "":
cfo.addEntry("local.storage.uuid", str(bash("uuidgen").getStdout()))
cfo.addEntry("resource", "com.cloud.hypervisor.kvm.resource.LibvirtComputingResource")
if cfo.getEntry("resource") == "":
cfo.addEntry("resource", "com.cloud.hypervisor.kvm.resource.LibvirtComputingResource")
cfo.save()
self.syscfg.svo.stopService("cloudstack-agent")