Changeset 4069 for lliurex-up
- Timestamp:
- Mar 29, 2017, 2:53:59 PM (4 years ago)
- Location:
- lliurex-up/trunk/fuentes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-up/trunk/fuentes/lliurex-up-cli/usr/sbin/lliurex-upgrade
r4068 r4069 203 203 log_msg="Install initial metapackage:" + self.targetMetapackage + ": Returncode: " + str(self.returncode_initflavour) + " Error: " + str(error) 204 204 self.log(log_msg) 205 print " [Lliurex-up]: Metapackage is now installed: " + str(self.returncode_initflavour) + " Error: " + str(error)205 print " [Lliurex-up]: Metapackage is now installed: Returncode: " + str(self.returncode_initflavour) + " Error: " + str(error) 206 206 207 207 #def checkingInitialFlavourToInstall … … 300 300 def postActionsScript(self,extra_args): 301 301 302 self.postActionsError=False 302 303 print(" [Lliurex-up]: Ending the update") 303 304 304 305 if extra_args["unattendend_upgrade"]: 305 command="DEBIAN_FRONTEND=noninteractive " + self.lliurexcore.postActionsScript() +'| tee ' + self.lliurexcore.errorpostaction_token306 else: 307 command=self.lliurexcore.postActionsScript() +'| tee ' + self.lliurexcore.errorpostaction_token306 command="DEBIAN_FRONTEND=noninteractive " + self.lliurexcore.postActionsScript() 307 else: 308 command=self.lliurexcore.postActionsScript() 308 309 309 310 try: 310 subprocess.Popen(command,shell=True).communicate() 311 p=subprocess.Popen(command,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE) 312 poutput,perror=p.communicate() 313 if len(perror)>0: 314 self.postActionsError=True 315 log_msg="Exec Post-Actions. Error: " + str(perror) 316 else: 317 log_msg="Exec Post-Actions. OK: " 311 318 #os.system(command) 312 log_msg="Exec Post-Actions" 313 self.log(log_msg) 319 #log_msg="Exec Post-Actions" 320 self.log(log_msg) 321 314 322 except Exception as e: 315 323 print e … … 320 328 def checkingFinalFlavourToInstall(self): 321 329 330 self.finalFlavourError=False 322 331 print(" [Lliurex-up]: Checking final metapackage") 323 332 … … 332 341 333 342 command=self.lliurexcore.installFinalFlavour(self.flavourToInstall) 334 try: 335 #os.system(command) 336 subprocess.Popen(command,shell=True).communicate() 337 338 except Exception as e: 339 print e 343 p=subprocess.Popen(command,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE) 344 poutput,perror=p.communicate() 345 346 if len(perror)>0: 347 self.finalFlavourError=True 348 log_msg=" Metapackage installation. Error: " + str(self.perror) 349 print (" [Lliurex-up]: Metapackage installation. Error:" + str(self.perror)) 350 else: 351 log_msg=" Metapackage installation. OK" 352 print (" [Lliurex-up]: Metapackage installation. OK") 353 354 self.log(log_msg) 355 340 356 else: 341 357 print (" [Lliurex-up]: Metapackage is correct. Nothing to do") … … 348 364 error=self.lliurexcore.checkErrorDistUpgrade() 349 365 350 if error :366 if error or self.postActionsError or self.finalFlavourError: 351 367 print(" [Lliurex-up]: The updated process is endend with errors") 352 368 log_msg="Dist-upgrade process ending with errors" -
lliurex-up/trunk/fuentes/python-lliurex-up/lliurex/lliurexup/__init__.py
r4053 r4069 24 24 self.previousflavourspath = os.path.join(self.processPath,'previousflavours') 25 25 self.errorpostaction_token=os.path.join(self.processPath,'errorpostaction_token') 26 self.errorfinalmetapackage_token=os.path.join(self.processPath,'errorfinalmetapackage_token') 26 27 self.errorupgrade_token=os.path.join(self.processPath,'errorupgrade_token') 27 28 self.finalupgrade_token=os.path.join(self.processPath,'finalupgrade_token') … … 442 443 p = subprocess.Popen(command,shell=True,stdout=subprocess.PIPE) 443 444 poutput,perror = p.communicate() 445 446 if p.returncode!=0: 447 command = "LANG=C LANGUAGE=en DEBIAN_FRONTEND=noninteractive apt-get install -f -y --force-yes {options} ".format(options=options) 448 p = subprocess.Popen(command,shell=True,stdout=subprocess.PIPE) 449 poutput,perror = p.communicate() 450 451 444 452 return {'returncode':p.returncode,'stdout':poutput,'stderrs':perror} 445 453
Note: See TracChangeset
for help on using the changeset viewer.