summaryrefslogtreecommitdiffstats
path: root/src/com.gluster.storage.management.gateway.scripts
diff options
context:
space:
mode:
authorTim <timothyasir@gluster.com>2011-08-17 17:52:38 +0530
committerTim <timothyasir@gluster.com>2011-08-17 17:52:38 +0530
commit1b05efa50f939412f476cb237d436d281965a9f9 (patch)
tree05233435580e45931f423ca1d4bc01a8835785e7 /src/com.gluster.storage.management.gateway.scripts
parent40f1c8299386e485633cd99d872200be4ee1f43a (diff)
Removed Commands.py, GetServerNetworkConfig.py
Diffstat (limited to 'src/com.gluster.storage.management.gateway.scripts')
-rw-r--r--src/com.gluster.storage.management.gateway.scripts/src/backend/Commands.py78
-rw-r--r--src/com.gluster.storage.management.gateway.scripts/src/backend/GetServerNetworkConfig.py103
2 files changed, 0 insertions, 181 deletions
diff --git a/src/com.gluster.storage.management.gateway.scripts/src/backend/Commands.py b/src/com.gluster.storage.management.gateway.scripts/src/backend/Commands.py
deleted file mode 100644
index c728b565..00000000
--- a/src/com.gluster.storage.management.gateway.scripts/src/backend/Commands.py
+++ /dev/null
@@ -1,78 +0,0 @@
-COMMAND_CREATE_VOLUME = "create-volume"
-COMMAND_DELETE_VOLUME = "delete-volume"
-COMMAND_START_VOLUME = "start-volume"
-COMMAND_STOP_VOLUME = "stop-volume"
-COMMAND_GET_VOLUME_HEALTH_STATUS = "get-volume-health-status"
-COMMAND_GET_VOLUME_LIST = "get-volume-list"
-COMMAND_GET_VOLUME_LOG = "get-volume-log"
-COMMAND_CLEAR_VOLUME_LOGS = "clear-volume-logs"
-COMMAND_GET_VOLUME_PROPERTY = "get-volume-property"
-COMMAND_SET_VOLUME_PROPERTY = "set-volume-property"
-COMMAND_GET_VOLUME_STATUS = "get-volume-status"
-COMMAND_DOWNLOAD_VOLUME_LOGS = "download-volume-logs"
-COMMAND_DELETE_SERVER = "delete-server"
-COMMAND_GET_SERVER_DATE = "get-server-date"
-COMMAND_GET_SERVER_VERSION_INFO = "get-server-version-info"
-COMMAND_GET_INSTALLER_INFO = "get-installer-info"
-COMMAND_GET_SERVER_LIST = "get-server-list"
-COMMAND_GET_SERVER_SERVICE_STATUS = "get-server-service-status"
-COMMAND_GET_STORAGE_SERVER_POOL_INFO = "get-storage-server-pool-info"
-COMMAND_INSTALL_SERVER_BACKGROUND = "install-server-background"
-COMMAND_PREPARE_DATA_DISK_BACKGROUND = "prepare-data-disk-background"
-COMMAND_SET_SERVER_DATE = "set-server-date"
-COMMAND_SET_SERVER_NETWORK_CONFIG = "set-server-network-config"
-COMMAND_SET_STORAGE_SERVER_POOL_INFO = "set-storage-server-pool-info"
-COMMAND_GET_SERVER_NETWORK_CONFIG = "get-server-network-config"
-COMMAND_INSTALL_SERVER_STATUS = "install-server-status"
-COMMAND_GET_SERVER_DISK_LIST = "get-server-disk-list"
-COMMAND_PREPARE_DATA_DISK_STATUS = "prepare-data-disk-status"
-COMMAND_GET_SERVER_SYSTEM_RESOURCE = "get-server-system-resource"
-COMMAND_GET_SERVER_RESOURCE_RRD = "get-server-resource-rrd"
-COMMAND_RUN_SERVER_SERVICE = "run-server-service"
-COMMAND_SHUTDOWN_SERVER = "shutdown-server"
-COMMAND_GET_SERVER_STATUS = "get-server-status"
-COMMAND_GET_SERVER_LOG = "get-server-log"
-COMMAND_DOWNLOAD_SERVER_LOGS = "download-server-logs"
-COMMAND_CLEAR_SERVER_LOGS = "clear-server-logs"
-COMMAND_GET_SERVER_RESOURCE_RRD = "get-server-resource-rrd"
-COMMAND_GET_GSN_USER_INFO = "get-gsn-user-info"
-COMMAND_SET_GSN_USER_INFO = "set-gsn-user-info"
-COMMAND_GET_GLUSTER_UPDATE_INFO = "get-gluster-update-info"
-COMMAND_DOWNLOAD_GLUSTER_UPDATE_BACKGROUND = "download-gluster-update-background"
-COMMAND_DOWNLOAD_GLUSTER_UPDATE_STATUS = "download-gluster-update-status"
-COMMAND_INSTALL_GLUSTER_UPDATE = "install-gluster-update"
-COMMAND_EXPORT_CONFIG = "export-config"
-COMMAND_IMPORT_CONFIG = "import-config"
-COMMAND_SET_SYSTEM_PASSWORD = "set-system-password"
-COMMAND_GET_SERVER_VOLUME_LIST = "get-server-volume-list"
-COMMAND_RECONFIGURE_VOLUME = "reconfigure-volume"
-COMMAND_SET_SERVER_DIRECTORY_SERVICE_CONFIG = "set-server-directory-service-config"
-COMMAND_GET_SERVER_DIRECTORY_SERVICE_CONFIG = "get-server-directory-service-config"
-COMMAND_JOIN_SERVER_TO_DIRECTORY_SERVICE = "join-server-to-directory-service"
-COMMAND_SET_SERVER_TIME_CONFIG = "set-server-time-config"
-COMMAND_GET_SERVER_TIME_CONFIG = "get-server-time-config"
-COMMAND_LOGIN = "login"
-COMMAND_LOGOUT = "logout"
-COMMAND_GET_LOGIN_STATUS = "get-login-status"
-COMMAND_GET_SERVER_TRANSPORT_LIST = "get-server-transport-list"
-COMMAND_ADD_SERVER_PARTITION = "add-server-partition"
-COMMAND_ADD_VOLUME_USER = "add-volume-user"
-COMMAND_GET_PARTITION_VOLUME_LIST = "get-partition-volume-list"
-COMMAND_GET_VOLUME_USER_INFO = "get-volume-user-info"
-COMMAND_GET_VOLUME_USER_LIST = "get-volume-user-list"
-COMMAND_MIGRATE_PARTITION_BACKGROUND = "migrate-partition-background"
-COMMAND_MIGRATE_PARTITION_STATUS = "migrate-partition-status"
-COMMAND_MIGRATE_VOLUME_SERVER_PARTITION_BACKGROUND = "migrate-volume-server-partition-background"
-COMMAND_MIGRATE_VOLUME_SERVER_PARTITION_STATUS = "migrate-volume-server-partition-status"
-COMMAND_REMOVE_SERVER_PARTITION = "remove-server-partition"
-COMMAND_REMOVE_VOLUME_USER = "remove-volume-user"
-COMMAND_RENAME_VOLUME_USER = "rename-volume-user"
-COMMAND_RENAME_VOLUME = "rename-volume"
-COMMAND_RUN_SERVER_SERVICE = "run-server-service"
-COMMAND_SET_VOLUME_USER_PASSWORD = "set-volume-user-password"
-COMMAND_STOP_PARTITION_MIGRATION = "stop-partition-migration"
-COMMAND_STOP_VOLUME_SERVER_PARTITION_MIGRATION = "stop-volume-server-partition-migration"
-COMMAND_GET_SERVER_DISK_INFO = "get-server-disk-info"
-COMMAND_INITIALIZE_SERVER_DISK = "initialize-server-disk"
-COMMAND_SET_SERVER_COUNT = "set-server-count"
-COMMAND_GET_SERVER_COUNT = "get-server-count"
diff --git a/src/com.gluster.storage.management.gateway.scripts/src/backend/GetServerNetworkConfig.py b/src/com.gluster.storage.management.gateway.scripts/src/backend/GetServerNetworkConfig.py
deleted file mode 100644
index 54f68caf..00000000
--- a/src/com.gluster.storage.management.gateway.scripts/src/backend/GetServerNetworkConfig.py
+++ /dev/null
@@ -1,103 +0,0 @@
-# Copyright (C) 2009 Gluster, Inc. <http://www.gluster.com>
-# 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
-# <http://www.gnu.org/licenses/>.
-
-import os
-import sys
-p1 = os.path.abspath(os.path.dirname(sys.argv[0]))
-p2 = "%s/common" % os.path.dirname(p1)
-if not p1 in sys.path:
- sys.path.append(p1)
-if not p2 in sys.path:
- sys.path.append(p2)
-import syslog
-import Globals
-import Commands
-import re
-from ServerUtils import *
-from Protocol import *
-from NetworkUtils import *
-
-def getServerNetworkConfig(requestXml):
- serverName = requestXml.getTextByTagRoute("command.server-name")
- version = requestXml.getVersion()
- messageId = requestXml.getAttribute("id")
-
- if not serverName:
- responseDom = ResponseXml(Commands.COMMAND_GET_SERVER_NETWORK_CONFIG, "No server name given", messageId, version)
- responseDom.appendTagRoute("server.name", serverName)
- return responseDom
- responseDom = ResponseXml(Commands.COMMAND_GET_SERVER_NETWORK_CONFIG, "OK", messageId, version)
- serverTag = responseDom.createTag("server", None)
- serverTag.appendChild(responseDom.createTag("name", serverName))
- nameServerList, domain, searchDomain = readResolvConfFile()
- if domain:
- domainName = domain[0]
- else:
- domainName = None
- serverTag.appendChild(responseDom.createTag("domainname", domainName))
- i = 1
- for dns in nameServerList:
- serverTag.appendChild(responseDom.createTag("dns%s" % i, dns))
- i += 1
- #TODO: probe and retrieve timezone, ntp-server, preferred-network details and update the tags
- configDom = XDOM()
- if configDom.parseFile("%s/%s/network.xml" % (Globals.SERVER_CONF_DIR, serverName)):
- serverTag.appendChild(responseDom.createTag("timezone", configDom.getTextByTagRoute("network.timezone")))
- serverTag.appendChild(responseDom.createTag("ntp-server", configDom.getTextByTagRoute("network.ntp-server")))
- preferredNetwork = configDom.getTextByTagRoute("network.preferred-network")
- if not preferredNetwork:
- preferredNetwork = "any"
- serverTag.appendChild(responseDom.createTag("preferred-network", preferredNetwork))
-
- deviceList = {}
- for device in getNetDeviceList():
- deviceList[device["device"]] = device
- try:
- macAddress = open("/sys/class/net/%s/address" % device["device"]).read().strip()
- except IOError:
- continue
- interfaceTag = responseDom.createTag("interface", None)
- interfaceTag.appendChild(responseDom.createTag("device", device["device"]))
- interfaceTag.appendChild(responseDom.createTag("description", device["description"]))
- interfaceTag.appendChild(responseDom.createTag("hwaddr", macAddress))
- if deviceList[device["device"]]:
- if deviceList[device["device"]]["onboot"]:
- interfaceTag.appendChild(responseDom.createTag("onboot", "yes"))
- else:
- interfaceTag.appendChild(responseDom.createTag("onboot", "no"))
- interfaceTag.appendChild(responseDom.createTag("bootproto", deviceList[device["device"]]["bootproto"]))
- interfaceTag.appendChild(responseDom.createTag("ipaddr", deviceList[device["device"]]["ipaddr"]))
- interfaceTag.appendChild(responseDom.createTag("netmask", deviceList[device["device"]]["netmask"]))
- interfaceTag.appendChild(responseDom.createTag("gateway", deviceList[device["device"]]["gateway"]))
- if deviceList[device["device"]]["mode"]:
- interfaceTag.appendChild(responseDom.createTag("mode", deviceList[device["device"]]["mode"]))
- if deviceList[device["device"]]["master"]:
- interfaceTag.appendChild(responseDom.createTag("bonding", "yes"))
- spliter = re.compile(r'[\D]')
- interfaceTag.appendChild(responseDom.createTag("bondid", spliter.split(device["master"])[-1]))
- else:
- interfaceTag.appendChild(responseDom.createTag("onboot", "no"))
- interfaceTag.appendChild(responseDom.createTag("bootproto", "none"))
- serverTag.appendChild(interfaceTag)
- responseDom.appendTag(serverTag)
- return responseDom
-
-def test():
- requestString = """<command request="get-server-network-config" id="123" version="3.1.2.2">
-<server-name>s1</server-name></command>"""
- requestDom = RequestXml(requestString)
- print getServerNetworkConfig(requestDom).toxml()