From c89a76aca5feb04cd44a0baf65ea219dead80dc3 Mon Sep 17 00:00:00 2001 From: Britney Fransen Date: Fri, 16 Oct 2015 18:19:04 +0000 Subject: LinHES-config: mv_fileshare.py: add support to read in templates/nfs.shares to include custom nfs shares in /etc/exports --- abs/core/LinHES-config/PKGBUILD | 4 ++-- abs/core/LinHES-config/mv_fileshare.py | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/abs/core/LinHES-config/PKGBUILD b/abs/core/LinHES-config/PKGBUILD index 64ee3b3..54b6a83 100755 --- a/abs/core/LinHES-config/PKGBUILD +++ b/abs/core/LinHES-config/PKGBUILD @@ -1,6 +1,6 @@ pkgname=LinHES-config pkgver=8.3 -pkgrel=21 +pkgrel=22 conflicts=(MythVantage-config MythVantage-config-dev LinHES-config-dev LinHes-config ) pkgdesc="Install and configure your system" depends=('bc' 'libstatgrab' 'mysql-python' 'expect' 'curl' 'dnsutils' 'parted' @@ -174,7 +174,7 @@ md5sums=('17d9dd5a097fbbd4dae75dff8e2677ff' '38665330aeb3a8bdf7be24857fe035bb' '80685e047993b00161be29e3580f3a40' 'b79fe6ef82b0b5e71d62806e773ed556' - '595663a2cb0b43c4ea3fb3dac915a3c8' + '3cb673adb83b6afa52cffaa621b9d96b' '781f161a79c3188a31c8615b8258b241' '888a6c57f272d9fa3e77e216a421562b' 'cdd5008ee77e67c1d51ad73a24612485' diff --git a/abs/core/LinHES-config/mv_fileshare.py b/abs/core/LinHES-config/mv_fileshare.py index 58c11d8..5844a2f 100755 --- a/abs/core/LinHES-config/mv_fileshare.py +++ b/abs/core/LinHES-config/mv_fileshare.py @@ -327,7 +327,6 @@ def setup_etc_exports(shares,data_config,servername,nfslist): templine = "%s %s" %(sharename,mountpoint) nfs_map_auto.append(templine) - #create the lists for both /etc/exports and nfs_map_auto for share in shares: if share == "/myth": @@ -354,6 +353,22 @@ def setup_etc_exports(shares,data_config,servername,nfslist): templine = nfs_auto_line %(servername,tempname,tempname) nfs_map_auto.append(templine) + #read in users templates/nfs.shares + logging.debug(" processing nfs.shares file") + nfsshares_file=data_config.MYTHHOME+"/templates/nfs.shares" + try: + f = open(nfsshares_file,"r") + for line in f.read().splitlines(): + if line.startswith("#"): + continue + item = line.split() + if len(line) <= 1 : + continue + logging.debug(" %s",line) + share_list.append(line) + except : + logging.critical(" Couldn't read %s",nfsshares_file) + new_exports=[] new_exports.append("#This file was generated by systemconfig.py -m fileshare") new_exports.append("#Use exportfs -arv to reread. \n\n") -- cgit v0.12