Changeset 4867
- Timestamp:
- May 23, 2017, 10:19:42 AM (4 years ago)
- Location:
- n4d-nfs/trunk/fuentes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
n4d-nfs/trunk/fuentes/debian/postinst
r1116 r4867 24 24 25 25 n4d-modules enable-plugin /etc/n4d/conf.d/NfsManager || true 26 27 if dpkg --compare-versions "$2" lt 0.4; then 28 29 if [ -e "/net/exports/net.exports" ]; then 30 31 python -c "import imp;imp.load_source('NfsManager','/usr/share/n4d/python-plugins/NfsManager.py').NfsManager().fix_missing_no_root_squash()" 32 33 fi 34 35 36 fi 37 38 26 39 ;; 27 40 -
n4d-nfs/trunk/fuentes/install/etc/n4d/conf.d/NfsManager
r2264 r4867 12 12 backup=adm,admins 13 13 restore=adm,admins 14 fix_missing_no_root_squash=adm,admins -
n4d-nfs/trunk/fuentes/install/usr/share/n4d/python-plugins/NfsManager.py
r4337 r4867 14 14 self.nfs_dir="/etc/exports.d/" 15 15 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" 17 17 self.regex_pattern="^(/[\-/\w]+)(\s+)((((\d{1,3}\.){3}\d{1,3})|\w+)\((.*)\)(\s+|$))+" 18 18 self.file_header="#\n# File generated by NfsManager plugin. Do not edit\n#\n\n" … … 68 68 69 69 #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 70 83 71 84 … … 176 189 file_name=p.communicate()[0].strip("\n")+".mount" 177 190 file_dest="/lib/systemd/system/"+file_name 178 print tmpfilepath179 print target.lstrip("/")180 print file_dest181 191 182 192 n4d_mv(tmpfilepath,file_dest,True,'root','root','0644',False ) … … 310 320 if __name__=="__main__": 311 321 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.