summaryrefslogtreecommitdiffstats
path: root/extras/volgen/CreateBooster.py
diff options
context:
space:
mode:
authorHarshavardhana <harsha@gluster.com>2010-04-14 20:20:38 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-04-22 07:05:07 -0700
commitbf18a37a1b66ca3ac75713d39e68dde1a116f4cf (patch)
tree45ac161136890acf9bfe92acdda39f00f83f531e /extras/volgen/CreateBooster.py
parent7c7bafa3b17dcc0c799b5d42ccb5726e52c4d94f (diff)
extras/volgen: Volgen patchset
-- Supports NFS Translator. -- Consolidated common API's into Common.py. -- Removed unused CreateBooster.py. -- Added code for "--add-server" for dynamic volumes. Currently its commented out we will use it when needed. -- No more options hiding in background anymore. All options specified for each translator are commented and exposed. Only necessary values are enabled. This is done due to necessary cleanup of unwanted options by exposing them. PENDING: "replicate" translator -- Quota is disabled for native NFS on client side. Only server side quota can be used as of now. -- Additional code cleanup. Signed-off-by: Harshavardhana <harsha@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 822 (Volgen changes supporting NFS) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=822
Diffstat (limited to 'extras/volgen/CreateBooster.py')
-rw-r--r--extras/volgen/CreateBooster.py140
1 files changed, 0 insertions, 140 deletions
diff --git a/extras/volgen/CreateBooster.py b/extras/volgen/CreateBooster.py
deleted file mode 100644
index 13a72f03bff..00000000000
--- a/extras/volgen/CreateBooster.py
+++ /dev/null
@@ -1,140 +0,0 @@
-# Copyright (c) 2009-2010 Gluster, Inc. <http://www.gluster.com>
-# This file is part of GlusterFS.
-
-# GlusterFS 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.
-
-# GlusterFS 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/>.
-
-GLUSTERFS_BOOSTER_FSTAB = "booster.fstab"
-GLUSTERFS_UNFS3_EXPORTS = "boosterexports"
-GLUSTERFS_CIFS_CONFIG = "boostersmb.conf"
-LOGDIR = "/var/log/glusterfs"
-fstype = "glusterfs"
-
-class CreateBooster:
-
- def __init__ (self, options, transports):
-
- self.volume_name = options.volume_name
- self.need_nfs = options.need_nfs
- self.need_cifs = options.need_cifs
- self.username = options.cifs_username
- self.enable_guest = options.enable_guest
- self.conf_dir = options.conf_dir
- self.transports = transports
-
- def configure_booster_fstab (self):
-
- _fstab = ""
- _options = ""
- _options_log = ""
- _options_ext = ""
-
- if self.conf_dir:
- booster_fstab_fd = file ("%s/%s" % (str(self.conf_dir),
- GLUSTERFS_BOOSTER_FSTAB), "a")
- else:
- booster_fstab_fd = file (GLUSTERFS_BOOSTER_FSTAB, "a")
-
- if self.need_nfs:
- for transport in self.transports:
- if self.conf_dir:
- _fstab = "%s/%s-%s.vol %s" % (str(self.conf_dir),
- self.volume_name,
- transport,
- str("/nfs/" +
- self.volume_name))
- else:
- _fstab = "%s-%s.vol %s" % (self.volume_name,
- transport,
- str("/nfs/" +
- self.volume_name))
-
- _options = "%s" % fstype
- _options_log = "logfile=%s/%s-nfs.log" % (LOGDIR, self.volume_name)
- _options_ext = "loglevel=ERROR,attr_timeout=0"
- booster_fstab_fd.write ("%s %s %s,%s\n" %
- (_fstab,
- _options,
- _options_log,
- _options_ext))
-
- if self.need_cifs:
- for transport in self.transports:
- if self.conf_dir:
- _fstab = "%s/%s-%s.vol %s" % (self.conf_dir,
- self.volume_name,
- transport,
- str("/cifs/" +
- self.volume_name))
- else:
- _fstab = "%s-%s.vol %s" % (self.volume_name,
- transport,
- str("/cifs/" +
- self.volume_name))
-
- _options = "%s" % fstype
- _options_log = "logfile=%s/%s-cifs.log" % (LOGDIR, self.volume_name)
- _options_ext = "loglevel=ERROR,attr_timeout=0"
- booster_fstab_fd.write ("%s %s %s,%s\n" %
- (_fstab,
- _options,
- _options_log,
- _options_ext))
-
- return
-
- def configure_nfs_booster (self):
-
- if self.conf_dir:
- nfs_exports_fd = file ("%s/%s" % (str(self.conf_dir),
- GLUSTERFS_UNFS3_EXPORTS), "a")
- else:
- nfs_exports_fd = file (GLUSTERFS_UNFS3_EXPORTS, "a")
-
- nfs_exports_fd.write ("%s 0.0.0.0/0(rw,no_root_squash)\n" %
- str("/nfs/" + self.volume_name))
- return
-
- def configure_cifs_booster (self):
-
- if self.conf_dir:
- cifs_config_fd = file ("%s/%s" % (str(self.conf_dir),
- GLUSTERFS_CIFS_CONFIG), "a")
- else:
- cifs_config_fd = file (GLUSTERFS_CIFS_CONFIG, "a")
- cifs_config_fd.write ("[%s]\n" % self.volume_name)
- cifs_config_fd.write ("comment = %s volume served by Gluster\n" %
- self.volume_name)
- cifs_config_fd.write ("path = %s\n" % str("/cifs/" + self.volume_name))
-
- if self.enable_guest:
- cifs_config_fd.write ("guest ok = yes\n")
-
- cifs_config_fd.write ("public = yes\n")
- cifs_config_fd.write ("writable = yes\n")
- cifs_config_fd.write ("users = %s\n" % self.username)
- cifs_config_fd.close()
- return
-
- def configure_booster (self):
-
- self.configure_booster_fstab()
- if self.need_nfs:
- self.configure_nfs_booster()
- print "Generating booster configuration for NFS reexport"
- if self.need_cifs:
- self.configure_cifs_booster()
- print "Generating booster configuration for CIFS reexport"
-
- return