Eli Mesika has uploaded a new change for review. Change subject: core: fix PM settings in new host ......................................................................
core: fix PM settings in new host This patch fixes the following issue: 1) Add a new host to cluster, PM tab has these settings: Enable PM: true Kdump integration: false Type: ipmilan UserName, Password: filled in 2) Click to OK, host is deployed with success 3) Check the DB, that host doesn't have any records in fence_agents table 4) Try to Edit the host, PM tab contains these settings: Enable PM: true Kdump integration: false Type: apc UserName, Password: empty 5) Fill in data again and click OK 6) fence_agents table contains record for the host Change-Id: I13ebea573105b7e8f6f8e7a33251e40ec11c165b Signed-off-by: emesika <emes...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsCommand.java 1 file changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/84/36584/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsCommand.java index db25db5..711dfb8 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsCommand.java @@ -31,6 +31,7 @@ import org.ovirt.engine.core.common.action.VdsActionParameters; import org.ovirt.engine.core.common.action.VdsOperationActionParameters.AuthenticationMethod; import org.ovirt.engine.core.common.businessentities.BusinessEntitiesDefinitions; +import org.ovirt.engine.core.common.businessentities.FenceAgent; import org.ovirt.engine.core.common.businessentities.Provider; import org.ovirt.engine.core.common.businessentities.StoragePool; import org.ovirt.engine.core.common.businessentities.VDS; @@ -284,6 +285,7 @@ DbFacade.getInstance().getVdsStaticDao().save(getParameters().getVdsStaticData()); getCompensationContext().snapshotNewEntity(getParameters().getVdsStaticData()); setVdsIdRef(getParameters().getVdsStaticData().getId()); + addFenceAgents(); setVds(null); } @@ -580,4 +582,14 @@ } return jobProperties; } + + private void addFenceAgents() { + if (getParameters().getFenceAgents() != null) { // if == null, means no update. Empty list means + for (FenceAgent agent : getParameters().getFenceAgents()) { + agent.setHostId(getVdsId()); + DbFacade.getInstance().getFenceAgentDao().save(agent); + } + } + } + } -- To view, visit http://gerrit.ovirt.org/36584 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I13ebea573105b7e8f6f8e7a33251e40ec11c165b Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Eli Mesika <emes...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches