Ignore:
Timestamp:
May 23, 2017, 10:19:42 AM (3 years ago)
Author:
hectorgh
Message:

adding no_root_squash

File:
1 edited

Legend:

Unmodified
Added
Removed
  • n4d-nfs/trunk/fuentes/install/usr/share/n4d/python-plugins/NfsManager.py

    r4337 r4867  
    1414                self.nfs_dir="/etc/exports.d/"
    1515                self.nfs_file=self.nfs_dir+"net.exports"
    16                 self.default_options="rw,sync,no_subtree_check"
     16                self.default_options="rw,sync,no_subtree_check,no_root_squash"
    1717                self.regex_pattern="^(/[\-/\w]+)(\s+)((((\d{1,3}\.){3}\d{1,3})|\w+)\((.*)\)(\s+|$))+"
    1818                self.file_header="#\n# File generated by NfsManager plugin. Do not edit\n#\n\n"
     
    6868       
    6969        #def parse_exports_file
     70
     71        def fix_missing_no_root_squash(self):
     72               
     73                exports=self.parse_exports_file()
     74
     75                for d in exports:
     76                        for ip in exports[d]:
     77                                if "no_root_squash" in exports[d][ip]:
     78                                        exports[d][ip]+=",no_root_squash"
     79
     80                self.write_exports_file(exports)
     81
     82        #def fix_missing_no_root_squash
    7083       
    7184
     
    176189                file_name=p.communicate()[0].strip("\n")+".mount"
    177190                file_dest="/lib/systemd/system/"+file_name
    178                 print tmpfilepath
    179                 print target.lstrip("/")
    180                 print file_dest
    181191               
    182192                n4d_mv(tmpfilepath,file_dest,True,'root','root','0644',False )
     
    310320if __name__=="__main__":
    311321       
    312         nfsman=NfsManager()
    313        
    314         #nfsman.add_share("/net","172.20.8.5")
    315         nfsman.parse_exports_file()
    316         nfsman.remove_ip_from_share("/net","1.2.3.4")
    317         nfsman.add_share("/pepito","2.3.4.4","one,two,three")
    318         nfsman.configure_mount_on_boot("server:/net","/net/server-sync")
    319 
     322        pass
     323
     324
Note: See TracChangeset for help on using the changeset viewer.