Changeset 2137
- Timestamp:
- Jul 8, 2016, 6:10:50 PM (5 years ago)
- Location:
- lliurex-mirror/trunk/fuentes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-mirror/trunk/fuentes/lliurex-mirror-cli/etc/bash_completion.d/lliurex-mirror
r1968 r2137 10 10 # The basic options we'll complete. 11 11 # 12 opts="setcname rundebmirror isalive getmirrorarchitecture setmirrorarchitecture getmirrororig setmirrororig getchecksumvalidation setchecksumvalidation getpercentage enablewebserverforpath stopwebserver getavailabledistros -H --host -k --key -u --user -p --password "12 opts="setcname rundebmirror isalive getmirrorarchitecture setmirrorarchitecture getmirrororig setmirrororig getchecksumvalidation setchecksumvalidation getpercentage enablewebserverforpath stopwebserver getavailabledistros -H --host -k --key -u --user -p --password stopupdate" 13 13 14 14 # -
lliurex-mirror/trunk/fuentes/lliurex-mirror-cli/usr/bin/lliurex-mirror
r2044 r2137 73 73 def stopWebserver(self): 74 74 result = self.client.stop_webserver(self.credentials,"MirrorManager") 75 print str(result['msg']) 76 sys.exit( 0 if result['status'] else 1 ) 77 78 def stopUpdate(self): 79 result = self.client.stopupdate(self.credentials,"MirrorManager") 75 80 print str(result['msg']) 76 81 sys.exit( 0 if result['status'] else 1 ) … … 99 104 puts("enablewebserverforpath PATH") 100 105 puts("stopwebserver") 106 puts("stopupdate") 101 107 puts("getavailabledistros") 102 108 puts("Flags") … … 197 203 elif action == "getavailabledistros": 198 204 lliurexmirror.getAvailableDistros() 199 200 205 elif action == "stopupdate": 206 lliurexmirror.stopUpdate() 207 208 -
lliurex-mirror/trunk/fuentes/n4d-lliurex-mirror.install/usr/share/n4d/python-plugins/MirrorManager.py
r2063 r2137 59 59 self.n4d_vars.set_variable("LLIUREXMIRROR",self.variable) 60 60 else: 61 self.variable[repo] = self.defaultmirrorinfo 61 if not self.variable.has_key(repo): 62 self.variable[repo] = self.defaultmirrorinfo 62 63 except Exception as e: 63 64 pass … … 152 153 if line1.startswith("[") and line1[5] == "]": 153 154 self.percentage=(int(line1[1:4].strip()),self.debmirrorprocess.exitstatus) 155 self.variable[distro]['progress'] = self.percentage[0] 156 self.n4d_vars.set_variable("LLIUREXMIRROR",self.variable) 154 157 except pexpect.EOF: 155 158 line1 = self.debmirrorprocess.before … … 160 163 status = self.debmirrorprocess.exitstatus 161 164 self.percentage=(self.percentage[0],status) 162 165 self.variable[distro]['progress'] = self.percentage[0] 163 166 self.variable[distro]['status_mirror'] = "Ok" if status == 0 else "Error" 164 167 self.n4d_vars.set_variable("LLIUREXMIRROR",self.variable) … … 386 389 try: 387 390 self.debmirrorprocess.terminate() 388 return {'status': true,'msg':'debmirror stopped'}391 return {'status':True,'msg':'debmirror stopped'} 389 392 except Exception as e: 390 393 return {'status':False,'msg':str(e)}
Note: See TracChangeset
for help on using the changeset viewer.