Changeset 2489
- Timestamp:
- Sep 21, 2016, 3:39:57 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
r2482 r2489 24 24 25 25 def local_connect(self): 26 self.client = xmlrpclib.ServerProxy('https://localhost:9779' )26 self.client = xmlrpclib.ServerProxy('https://localhost:9779',allow_none=True) 27 27 try: 28 28 self.client.get_methods() … … 42 42 43 43 def mirror_list(self): 44 if self.client== None:44 if type(self.client) == None: 45 45 return {} 46 46 result = self.client.get_all_configs(self.credentials,'MirrorManager') … … 71 71 #def create_conf 72 72 73 def update(self,mirror,mode,data=None) 74 '''73 def update(self,mirror,mode,data=None): 74 ''' 75 75 mode is option to update mirror. (Internet, local network, folder) 76 76 data is extra info to update (local network ip, ) 77 '''77 ''' 78 78 self.mode = None 79 79 if mode == '2': … … 129 129 return result['status'] 130 130 #def stop_update 131 132 133 if __name__ == '__main__': 134 c = LliurexMirrorN4d('localhost',['kbut','lliurex']) 135 print c.mirror_list() -
lliurex-mirror/trunk/fuentes/n4d-lliurex-mirror.install/usr/share/n4d/python-plugins/MirrorManager.py
r2482 r2489 551 551 configfile = os.path.join(self.configpath,version) 552 552 f = open(configfile,'r') 553 allconfigs[version ] = json.load(f)553 allconfigs[version.replace('.json','')] = json.load(f) 554 554 f.close() 555 555 return {'status':True,'msg':allconfigs} … … 579 579 #def watch_update_finish 580 580 581 def _watch_update_finish(self,credentials,server) 581 def _watch_update_finish(self,credentials,server): 582 582 import time 583 583 import xmlrpclib as x … … 587 587 c = x.ServerProxy('https://'+ server +':9779') 588 588 result = c.is_alive(credentials,'MirrorManager') 589 if !result:589 if not result: 590 590 self.stop_webserver() 591 591 break … … 595 595 596 596 def is_alive_get_mirror(self): 597 return {'status':self.get_mirror_thread.is_alive(),'msg': }597 return {'status':self.get_mirror_thread.is_alive(),'msg':self.exportpercentage} 598 598 #def is_alive_get_mirror 599 599
Note: See TracChangeset
for help on using the changeset viewer.