Changeset 1152
- Timestamp:
- Apr 8, 2016, 1:31:35 PM (5 years ago)
- Location:
- n4d-nfs/trunk/fuentes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
n4d-nfs/trunk/fuentes/debian/changelog
r1117 r1152 1 n4d-nfs (0.2) xenial; urgency=high 2 3 * Adding functionality to reset configuration 4 5 -- Hector Garcia Huerta <hectorgh@gmail.com> Fri, 08 Apr 2016 13:29:49 +0200 6 1 7 n4d-nfs (0.1) xenial; urgency=medium 2 8 -
n4d-nfs/trunk/fuentes/install/etc/n4d/conf.d/NfsManager
r1116 r1152 8 8 remove_ip_from_share=adm,admins 9 9 configure_mount_on_boot=adm,admins 10 clean_exports_file=adm,admins 11 remove_mount_on_boot=adm,admins -
n4d-nfs/trunk/fuentes/install/usr/share/n4d/python-plugins/NfsManager.py
r1116 r1152 22 22 23 23 # LLX TESTING 24 self.nfs_file="/tmp/exports"24 #self.nfs_file="/tmp/exports" 25 25 # 26 27 if not os.path.exists(self.nfs_dir): 28 os.makedirs(self.nfs_dir) 26 29 27 30 … … 72 75 73 76 #ret=os.system("exportfs -ra") 74 p=subprocess.Popen(["export ","-ra"],stdout=subprocess.PIPE,stderr=subprocess.PIPE)77 p=subprocess.Popen(["exportfs","-ra"],stdout=subprocess.PIPE,stderr=subprocess.PIPE) 75 78 ret=p.communicate() 76 79 77 80 if p.poll()==0: 78 81 79 return {"status":True , "msg": " "}82 return {"status":True , "msg": "NFS shares exported"} 80 83 81 84 else: … … 112 115 self.write_exports_file(exports) 113 116 114 return {"status":True,"msg":" "}117 return {"status":True,"msg":"Removed IP from server"} 115 118 116 119 else: … … 148 151 f.close() 149 152 150 return {"status":True,"msg":" "}153 return {"status":True,"msg":"NFS exports.d file written"} 151 154 152 155 #def write_exports_file … … 191 194 192 195 #def configure_mount_on_boot 196 197 def remove_mount_on_boot(self,target): 198 199 p=subprocess.Popen(["systemd-escape",target.lstrip("/")],stdout=subprocess.PIPE) 200 file_name=p.communicate()[0].strip("\n")+".mount" 201 file_dest="/lib/systemd/system/"+file_name 202 203 ret="" 204 205 if os.path.exists(file_dest): 206 o2=subprocess.Popen(["systemctl","stop",file_name],stdout=subprocess.PIPE,stderr=subprocess.PIPE).communicate() 207 o=subprocess.Popen(["systemctl","disable",file_name],stdout=subprocess.PIPE,stderr=subprocess.PIPE).communicate() 208 os.remove(file_dest) 209 ret=(o,o2) 210 211 return {"status":True,"msg":ret} 212 213 #def remove_mount_on_boot 214 215 def clean_exports_file(self): 216 217 if os.path.exists(self.nfs_file): 218 os.remove(self.nfs_file) 219 self.export_directories() 220 221 return {"status":True,"msg":"NfsManager exports.d file is clean"} 222 193 223 194 224
Note: See TracChangeset
for help on using the changeset viewer.