Changeset 2510
- Timestamp:
- Sep 22, 2016, 2:58:29 PM (4 years ago)
- Location:
- lliurex-mirror/trunk/fuentes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-mirror/trunk/fuentes/lliurex-mirror-gui/lliurex_mirror_connect.py
r2509 r2510 97 97 def export(self, mirror,folder): 98 98 import tempfile 99 100 # Get config for this mirror 99 101 result = self.client.get_all_configs(self.credentials,'MirrorManager') 100 102 config = result['msg'][mirror] 103 104 # Open webserver for mirror and get ip 105 result = self.client.enable_webserver_into_folder(self.credentials,'MirrorManager',config['MIRROR_PATH']) 106 107 # Modify Config and write 108 101 109 config['MIRROR_PATH'] = folder 110 config[] = '3' 111 config['ORIGS']['3'] = self.serverip + ":" + str(result['msg']) 102 112 result = self.client.render_debmirror_config(self.credentials,'MirrorManager',config) 103 113 temp_file = tempfile.mktemp() … … 105 115 f.write(result['msg']) 106 116 f.close() 117 118 # Execute mirror 107 119 self.localclient.get_mirror(self.localcredentials,'MirrorManager',temp_file) 108 120 return True … … 116 128 def is_alive_export(self): 117 129 result = self.localclient.is_alive_get_mirror(self.localcredentials,'MirrorManager') 130 print result 118 131 return result['status'] 119 132 … … 146 159 #print c.update('llx16','3') 147 160 #print c.mirror_list() 148 #print c.export('llx16','/net/miexportacion')149 print c.is_alive_export()161 print c.export('llx16','/net/miexportacion') 162 #print c.is_alive_export() 150 163 #print c.get_percentage('llx16') 151 164 #print c.is_alive() -
lliurex-mirror/trunk/fuentes/n4d-lliurex-mirror.install/usr/share/n4d/python-plugins/MirrorManager.py
r2509 r2510 33 33 self.tpl_env = Environment(loader=FileSystemLoader('/usr/share/n4d/templates/lliurex-mirror')) 34 34 self.update_thread=threading.Thread() 35 self.get_mirror_thread = threading.Thread() 35 36 self.percentage=(0,None) 37 self.exportpercentage = 0 36 38 self.mirrorworking = None 37 39 self.webserverprocess = None
Note: See TracChangeset
for help on using the changeset viewer.