summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBala.FA <bala@gluster.com>2011-09-22 15:33:04 +0530
committerTim <timothyasir@gluster.com>2011-09-23 13:58:03 +0530
commita8d9189cd0898bf6ab0ee1f32cf475f17dc1cae6 (patch)
treeedb82adc8e67061b2dce5bbb31eb08fc38fa1c3f /src
parent3b0b5a804970fb41a77fc5c57f7926f6aa363e79 (diff)
Removed unused scripts
Signed-off-by: Bala.FA <bala@gluster.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/com.gluster.storage.management.gateway.scripts/src/backend/create_volume_directory.py54
-rwxr-xr-xsrc/com.gluster.storage.management.gateway.scripts/src/backend/disable-ssh-password-auth.sh30
-rwxr-xr-xsrc/com.gluster.storage.management.gateway.scripts/src/backend/get_disk_mount_point.py56
-rwxr-xr-xsrc/com.gluster.storage.management.gateway.scripts/src/backend/get_disk_name_by_path.py55
4 files changed, 0 insertions, 195 deletions
diff --git a/src/com.gluster.storage.management.gateway.scripts/src/backend/create_volume_directory.py b/src/com.gluster.storage.management.gateway.scripts/src/backend/create_volume_directory.py
deleted file mode 100755
index a4eb2627..00000000
--- a/src/com.gluster.storage.management.gateway.scripts/src/backend/create_volume_directory.py
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/python
-# Copyright (C) 2011 Gluster, Inc. <http://www.gluster.com>
-# This file is part of Gluster Management Gateway.
-#
-
-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 DiskUtils
-import Utils
-
-
-def main():
- if len(sys.argv) != 3:
- sys.stderr.write("usage: %s <disk name> <volume name>\n" % os.path.basename(sys.argv[0]))
- sys.exit(-1)
-
- disk = sys.argv[1]
- volumeName = sys.argv[2]
-
- # Retrieving disk uuid
- diskUuid = DiskUtils.getUuidByDiskPartition(DiskUtils.getDevice(disk))
-
- if not diskUuid:
- Utils.log("failed to find disk:%s uuid" % disk)
- sys.stderr.write("failed to find disk:%s uuid\n" % disk)
- sys.exit(1)
-
- # Retrieving disk mount point using disk uuid
- diskMountPoint = DiskUtils.getMountPointByUuid(diskUuid)
- if not os.path.exists(diskMountPoint):
- Utils.log("failed to retrieve disk:%s mount point" % disk)
- sys.stderr.write("failed to retrieve disk:%s mount point\n" % disk)
- sys.exit(2)
-
- # creating volume directory under disk mount point
- volumeDirectory = "%s/%s" % (diskMountPoint, volumeName)
- if os.path.exists(volumeDirectory):
- Utils.log("Volume directory:%s already exists" % (volumeDirectory))
- sys.stderr.write("Volume directory:%s already exists\n" % (volumeDirectory))
- sys.exit(3)
-
- rv = Utils.runCommand("mkdir %s" % volumeDirectory, root=True)
- if rv != 0:
- sys.stderr.write("Failed to create volume directory\n")
- sys.exit(rv)
-
-if __name__ == "__main__":
- main()
diff --git a/src/com.gluster.storage.management.gateway.scripts/src/backend/disable-ssh-password-auth.sh b/src/com.gluster.storage.management.gateway.scripts/src/backend/disable-ssh-password-auth.sh
deleted file mode 100755
index 07ee1a3a..00000000
--- a/src/com.gluster.storage.management.gateway.scripts/src/backend/disable-ssh-password-auth.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-
-#-----------------------------------------------------------------------------
-# disable-ssh-password-auth.sh
-# Script for disabling SSH password authentication. This is used by the
-# management gateway after installing the public key, so that the gluster
-# node can be accessed (using ssh) only from the management gateway.
-#-----------------------------------------------------------------------------
-
-CONFIG_FILE="/etc/ssh/sshd_config"
-TIMESTAMP=`date +%d%m%Y%H%M%S`
-BACKUP_FILE="${CONFIG_FILE}_${TIMESTAMP}"
-TEMP_FILE="/tmp/new_sshd_config_${TIMESTAMP}"
-
-# Modify config file to disable password authentication, redirect to a temp file
-# TODO: disable only if enabled!
-sed "s/^PasswordAuthentication yes$/PasswordAuthentication no/g" ${CONFIG_FILE} > ${TEMP_FILE}
-
-# Secure the file by changing permissions (600)
-chmod 600 ${TEMP_FILE}
-
-# Take backup of config file
-cp ${CONFIG_FILE} ${BACKUP_FILE}
-
-# Overwrite config file with the modified one
-mv ${TEMP_FILE} ${CONFIG_FILE}
-
-# Re-start ssh daemon
-/etc/init.d/sshd restart
-
diff --git a/src/com.gluster.storage.management.gateway.scripts/src/backend/get_disk_mount_point.py b/src/com.gluster.storage.management.gateway.scripts/src/backend/get_disk_mount_point.py
deleted file mode 100755
index cf966fec..00000000
--- a/src/com.gluster.storage.management.gateway.scripts/src/backend/get_disk_mount_point.py
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/python
-# Copyright (C) 2011 Gluster, Inc. <http://www.gluster.com>
-# This file is part of Gluster Management Gateway.
-#
-
-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 Utils
-import FsTabUtils
-from XmlHandler import ResponseXml
-
-
-def getmountpoint(path):
- if not path:
- Utils.log("Not a valid path:%s" % path)
- rs.appendTagRoute("status.code", "-1")
- rs.appendTagRoute("status.message", "Error: given path name is empty")
- return rs.toprettyxml()
-
- rs = ResponseXml()
- mountPoint = None
-
- for line in FsTabUtils.readFsTab():
- if path.startswith(line['MountPoint']):
- if not mountPoint:
- mountPoint = line['MountPoint']
- if len(line['MountPoint']) > len(mountPoint):
- mountPoint = line['MountPoint']
-
- if "/" == mountPoint or not mountPoint:
- Utils.log("failed to find mount point of the given path:%s" % path)
- rs.appendTagRoute("status.code", "-1")
- rs.appendTagRoute("status.message", "Error: Unable to find disk mount point")
- return rs.toprettyxml()
-
- rs.appendTagRoute("status.code", "0")
- rs.appendTagRoute("status.message", mountPoint)
- return rs.toprettyxml()
-
-def main():
- if len(sys.argv) != 2:
- sys.stderr.write("usage: %s <path>\n" % os.path.basename(sys.argv[0]))
- sys.exit(-1)
-
- path = sys.argv[1]
- print getmountpoint(path)
- sys.exit(0)
-
-if __name__ == "__main__":
- main()
diff --git a/src/com.gluster.storage.management.gateway.scripts/src/backend/get_disk_name_by_path.py b/src/com.gluster.storage.management.gateway.scripts/src/backend/get_disk_name_by_path.py
deleted file mode 100755
index e9955e21..00000000
--- a/src/com.gluster.storage.management.gateway.scripts/src/backend/get_disk_name_by_path.py
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/python
-# Copyright (C) 2011 Gluster, Inc. <http://www.gluster.com>
-# This file is part of Gluster Storage Platform.
-#
-
-import os
-import Utils
-from DiskUtils import *
-from XmlHandler import ResponseXml
-
-
-def getmountpoint(path):
- if not path:
- Utils.log("Not a valid path:%s" % path)
- rs.appendTagRoute("status.code", "-1")
- rs.appendTagRoute("status.message", "Error: given path name is empty")
- return rs.toprettyxml()
-
- rs = ResponseXml()
- mountPoint = None
- fsTabEntry = None
- for line in readFsTab():
- if path.startswith(line['MountPoint']):
- if not mountPoint:
- mountPoint = line['MountPoint']
- fsTabEntry = line
- if len(line['MountPoint']) > len(mountPoint):
- mountPoint = line['MountPoint']
- fsTabEntry = line
-
- if "/" == mountPoint or not mountPoint:
- Utils.log("failed to find mount point of the given path:%s" % path)
- rs.appendTagRoute("status.code", "-1")
- rs.appendTagRoute("status.message", "Error: Unable to find disk mount point")
- return rs.toprettyxml()
-
- rs.appendTagRoute("status.code", "0")
- if fsTabEntry["Device"].startswith("UUID="):
- rs.appendTagRoute("status.message", getDiskPartitionByUuid(fsTabEntry["Device"].split("UUID=")[-1]))
- else:
- rs.appendTagRoute("status.message", "Unable to find disk name")
- return rs.toprettyxml()
-
-def main():
- if len(sys.argv) != 2:
- sys.stderr.write("usage: %s <path>\n" % os.path.basename(sys.argv[0]))
- sys.exit(-1)
-
- path = sys.argv[1]
- print getmountpoint(path)
- sys.exit(0)
-
-if __name__ == "__main__":
- main()
-