Ori Liel has uploaded a new change for review.

Change subject: restapi: Remove deprecated host update code
......................................................................

restapi: Remove deprecated host update code

Remove deprecated code which updates Power-Management
fence agents in context of Host update

Change-Id: I457fc7a1b64bd8fe4fef78447876881139b0bad5
Signed-off-by: Ori Liel <ol...@redhat.com>
---
M 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendHostResource.java
1 file changed, 0 insertions(+), 30 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/35/41835/1

diff --git 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendHostResource.java
 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendHostResource.java
index 3d85dd4..234bc88 100644
--- 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendHostResource.java
+++ 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendHostResource.java
@@ -33,12 +33,9 @@
 import 
org.ovirt.engine.api.resource.externalhostproviders.KatelloErrataResource;
 import org.ovirt.engine.api.restapi.model.AuthenticationMethod;
 import 
org.ovirt.engine.api.restapi.resource.externalhostproviders.BackendHostKatelloErrataResource;
-import org.ovirt.engine.api.restapi.types.DeprecatedPowerManagementMapper;
-import org.ovirt.engine.api.restapi.types.FenceAgentMapper;
 import org.ovirt.engine.api.utils.LinkHelper;
 import org.ovirt.engine.core.common.VdcObjectType;
 import org.ovirt.engine.core.common.action.ChangeVDSClusterParameters;
-import org.ovirt.engine.core.common.action.FenceAgentCommandParameterBase;
 import org.ovirt.engine.core.common.action.FenceVdsActionParameters;
 import org.ovirt.engine.core.common.action.FenceVdsManualyParameters;
 import org.ovirt.engine.core.common.action.ForceSelectSPMParameters;
@@ -56,7 +53,6 @@
 import org.ovirt.engine.core.common.businessentities.VDS;
 import org.ovirt.engine.core.common.businessentities.VDSGroup;
 import org.ovirt.engine.core.common.businessentities.VdsStatic;
-import org.ovirt.engine.core.common.businessentities.pm.FenceAgent;
 import org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult;
 import 
org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status;
 import org.ovirt.engine.core.common.businessentities.pm.PowerStatus;
@@ -116,8 +112,6 @@
             }
         }
 
-        // deprecatedUpdateFenceAgents(incoming);
-
         Host host = performUpdate(incoming,
                 entity,
                 map(entity),
@@ -137,30 +131,6 @@
                 host2.setId(host.getId());
                 agent.setHost(host2);
                 LinkHelper.addLinks(uriInfo, agent);
-            }
-        }
-    }
-
-    @SuppressWarnings("unused")
-    @Deprecated
-    /**
-     * In the past fence-agents appeared in-line in a host, and updating them 
was done through an update
-     * of the host. This is maintained for backwards-compatibility (for 
simplicity, agents are removed and
-     * re-added). Update of 3+ agents is not supported, since traditionally 
there were at most 2.
-     * This method does not handle deleting only one of the agents (existing 
bug).
-     */
-    private void deprecatedUpdateFenceAgents(Host incoming) {
-        List<FenceAgent> agents =
-                
DeprecatedPowerManagementMapper.map(incoming.getPowerManagement(),
-                        getFenceAgentsResource().getFenceAgents());
-        if (agents.isEmpty()) {
-            FenceAgentCommandParameterBase params = new 
FenceAgentCommandParameterBase();
-            params.setVdsId(guid);
-            performAction(VdcActionType.RemoveFenceAgentsByVdsId, params);
-        } else if (agents.size() < 3) {
-            for (FenceAgent agent : agents) {
-                getFenceAgentsResource().remove(agent.getId().toString());
-                getFenceAgentsResource().add(FenceAgentMapper.map(agent, 
null));
             }
         }
     }


-- 
To view, visit https://gerrit.ovirt.org/41835
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I457fc7a1b64bd8fe4fef78447876881139b0bad5
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ori Liel <ol...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to