Changeset 2594
- Timestamp:
- Oct 10, 2016, 5:05:12 PM (5 years ago)
- Location:
- lliurex-mirror/trunk/fuentes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-mirror/trunk/fuentes/lliurex-mirror2/lliurex-mirror.py
r2590 r2594 1438 1438 1439 1439 1440 self.user=" lliurex"1440 self.user="kbut" 1441 1441 self.password="lliurex" 1442 1442 -
lliurex-mirror/trunk/fuentes/n4d-lliurex-mirror.install/usr/share/n4d/python-plugins/MirrorManager.py
r2588 r2594 165 165 import datetime 166 166 fd.write("************************* " + str(datetime.datetime.now())+ " ***********************************\n") 167 fd.flush() 167 168 errors_found = False 168 169 self.debmirrorprocess=pexpect.spawn("/usr/bin/debmirror") 170 download_packages = False 171 emergency_counter = 0 169 172 try: 170 173 objects["ZCenterVariables"].add_pulsating_color("lliurexmirror") … … 173 176 while True: 174 177 try: 178 emergency_counter += 1 179 if emergency_counter > 100: 180 download_packages = True 175 181 self.debmirrorprocess.expect('\n',timeout=480) 176 182 line =self.debmirrorprocess.before 177 183 184 fd.write(line + "\n") 185 fd.flush() 186 if line.find("Files to download") >= 0 : 187 download_packages = True 178 188 line1=line.strip("\n") 179 fd.write(line)180 if line1.startswith("[") and line1[5] == "]":181 self.percentage=(int(line1[1:4].strip()),self.debmirrorprocess.exitstatus)182 self.variable[distro]['progress'] = self.percentage[0]183 self.n4d_vars.set_variable("LLIUREXMIRROR",self.variable)184 if line1.startswith("Everything OK"):185 self.percentage=(100,self.debmirrorprocess.exitstatus)186 self.variable[distro]['progress'] = 100187 self.n4d_vars.set_variable("LLIUREXMIRROR",self.variable)189 if download_packages: 190 if line1.startswith("[") and line1[5] == "]": 191 self.percentage=(int(line1[1:4].strip()),self.debmirrorprocess.exitstatus) 192 self.variable[distro]['progress'] = self.percentage[0] 193 self.n4d_vars.set_variable("LLIUREXMIRROR",self.variable) 194 if line1.startswith("Everything OK"): 195 self.percentage=(100,self.debmirrorprocess.exitstatus) 196 self.variable[distro]['progress'] = 100 197 self.n4d_vars.set_variable("LLIUREXMIRROR",self.variable) 188 198 189 199 if errors_found:
Note: See TracChangeset
for help on using the changeset viewer.