From bf531d097bc99db08bda4d1a1dec541c57c7933c Mon Sep 17 00:00:00 2001 From: Shireesh Anjal Date: Mon, 28 Mar 2011 06:58:51 -0700 Subject: Preparing src for migration to github --- .../src/nodes/ServerRequestHandler.py | 76 ---------------------- 1 file changed, 76 deletions(-) delete mode 100644 com.gluster.storage.management.server.scripts/src/nodes/ServerRequestHandler.py (limited to 'com.gluster.storage.management.server.scripts/src/nodes/ServerRequestHandler.py') diff --git a/com.gluster.storage.management.server.scripts/src/nodes/ServerRequestHandler.py b/com.gluster.storage.management.server.scripts/src/nodes/ServerRequestHandler.py deleted file mode 100644 index 31d4eb8c..00000000 --- a/com.gluster.storage.management.server.scripts/src/nodes/ServerRequestHandler.py +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright (C) 2010 Gluster, Inc. -# This file is part of Gluster Storage Platform. -# -# Gluster Storage Platform is free software; you can redistribute it -# and/or modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 3 of -# the License, or (at your option) any later version. -# -# Gluster Storage Platform is distributed in the hope that it will be -# useful, but WITHOUT ANY WARRANTY; without even the implied warranty -# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see -# . - -import os - -import Commands -from Protocol import * -from Globals import * -from GetServerNetworkConfig import * - -def handleRequestGetServerNetworkConfig(requestDom): - return getServerNetworkConfig(requestDom) - -def handleRequest(requestString): - log("Received request %s" % repr(requestString)) - - requestDom = XDOM() - requestDom.parseString(requestString) - if not requestDom: - log("Invalid request") - return None - - preRequestMap = {} - - postRequestMap = {} - - cleanupRequestMap = {} - - requestMap = { Commands.COMMAND_GET_SERVER_NETWORK_CONFIG : handleRequestGetServerNetworkConfig } - - messageId = requestDom.getMessageId() - if not messageId: - log("Invalid message Id") - return None - - requestCommand = requestDom.getRequestCommand() - if not requestCommand: - log("invalid request command") - return None - - requestAction = requestDom.getRequestAction() - version = requestDom.getVersion() - #if not isSupportedVersion(version): - # log("Unsupported version request %s" % requestDom.toxml()) - # return ResponseXml(requestCommand, "Unsupported version request", messageId, version).toxml() - - try: - if not requestAction: - responseDom = requestMap[requestCommand](requestDom) - elif requestAction.upper() == "PRE": - responseDom = preRequestMap[requestCommand](requestDom) - elif requestAction.upper() == "POST": - responseDom = postRequestMap[requestCommand](requestDom) - elif requestAction.upper() == "CLEANUP": - responseDom = cleanupRequestMap[requestCommand](requestDom) - else: - log("Unknown request action %s" % requestAction) - return None - return responseDom.toxml() - except KeyError: - log("No handler found for command %s for action %s" % (requestCommand, requestAction)) - return ResponseXml(requestCommand, "Invalid command", messageId, version).toxml() -- cgit