Changeset 6096


Ignore:
Timestamp:
Oct 27, 2017, 8:50:18 AM (2 years ago)
Author:
hectorgh
Message:

adding is_mount_configured

Location:
n4d-nfs/trunk/fuentes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • n4d-nfs/trunk/fuentes/debian/changelog

    r6094 r6096  
     1n4d-nfs (0.6.1) xenial; urgency=high
     2
     3  * Adding is_mount_configured functionality
     4  * write_file functionality skips shared paths with no ips to be shared to
     5
     6 -- Hector Garcia Huerta <hectorgh@gmail.com>  Fri, 27 Oct 2017 08:44:41 +0200
     7
    18n4d-nfs (0.6) xenial; urgency=high
    29
  • n4d-nfs/trunk/fuentes/install/etc/n4d/conf.d/NfsManager

    r6094 r6096  
    1212clean_exports_file=adm,admins
    1313remove_mount_on_boot=adm,admins
     14is_mount_configured=anonymous
    1415backup=adm,admins
    1516restore=adm,admins
  • n4d-nfs/trunk/fuentes/install/usr/share/n4d/python-plugins/NfsManager.py

    r6094 r6096  
    186186                        line="%s\t\t%s\n"
    187187                        ip_list=""
     188                        if len(exports[d]) ==0:
     189                                continue
    188190                        for ip in exports[d]:
    189191                                ip_list+="%s(%s) "%(ip,exports[d][ip])
     
    257259               
    258260        #def remove_mount_on_boot
     261       
     262       
     263        def is_mount_configured(self,target):
     264               
     265                p=subprocess.Popen(["systemd-escape",target.lstrip("/")],stdout=subprocess.PIPE)
     266                file_name=p.communicate()[0].strip("\n")+".mount"
     267                file_dest="/lib/systemd/system/"+file_name
     268               
     269                if os.path.exists(file_dest):
     270                        return {"status":True,"msg":"Mount systemd configuration exists"}
     271                else:
     272                        return {"status":False,"msg":"Mount systemd configuration doesn't exist"}
     273               
     274        #def is_mount_configured
    259275       
    260276       
Note: See TracChangeset for help on using the changeset viewer.