Project

General

Profile

Tâche #20960

Scénario #20865: Maj-Auto devrait détecter si une mise à jour précédente s'est terminée par des erreurs

Trouver comment détecter si dpkg est en erreur avec pkg.py

Added by Joël Cuissinat over 6 years ago. Updated about 6 years ago.

Status:
Fermé
Priority:
Normal
Assigned To:
Start date:
06/27/2017
Due date:
% Done:

100%

Estimated time:
4.00 h
Spent time:
Remaining (hours):
0.0

Description

Fonction dédié ou attributs déjà disponible dans le code existant...

Associated revisions

Revision b348d656 (diff)
Added by Joël Cuissinat over 6 years ago

Implémentation de "apt-eole ckeck"

Ref: #20960

Revision 4aa6f7e8 (diff)
Added by Joël Cuissinat over 6 years ago

Appel à la méthode "check" dans Maj-Auto

Ref: #20960

History

#1 Updated by Joël Cuissinat over 6 years ago

  • Status changed from Nouveau to En cours

#2 Updated by Joël Cuissinat over 6 years ago

  • Assigned To set to Laurent Flori

#3 Updated by Joël Cuissinat over 6 years ago

Tentative de codage pour : apt-eole check

  • dans parse_apt_cmdline():
        check = actions.add_parser(u'check', help=_(u'verify dpkg status'))
        check.set_defaults(func=u'check')
    
  • dans class EolePkgApt(object):
        def check(self, silent=False):
            """ check dpkg errors
    
            :param silent: do not display progress informations
            :type silent: `bool`
    
            """ 
            if system_out(['apt-get', 'install', '-f'])[0] != 0:
                raise PackageError(_(u"C'est tout planté !"))
            return 0
    
  • dans class EolePkg(object):
        def check(self, container=None, silent=True):
            """Check dpkg errors
    
            :param silent: do not display progress informations
            :type silent: `bool`
    
            """ 
            action = u'check'
            func = u'check'
    
            if container is None:
                container = u'all'
            return self._run(action=action,
                             func=func,
                             container=container,
                             silent=silent)
    
    

Dans /usr/bin/Maj-Auto, juste en-dessous de PKGMGR = EolePkg('apt', ignore=opts.ignore) :

PKGMGR.check()

#4 Updated by Laurent Flori over 6 years ago

La solution proposé par Joël fonctionne bien.
Sur l'amonecole il est peut etre un peu trop bavard mais c'est vraiment cosmetique:

Maj-Auto - Exécution de apt-eole -o --container current --log-level info check pour le conteneur reseau impossible: apt-eole - C'est tout planté !

#5 Updated by Joël Cuissinat over 6 years ago

  • % Done changed from 0 to 100
  • Remaining (hours) changed from 4.0 to 0.5

#6 Updated by Scrum Master over 6 years ago

  • Status changed from En cours to Résolu

#7 Updated by Benjamin Bohard about 6 years ago

  • Remaining (hours) changed from 0.5 to 0.0

#8 Updated by Benjamin Bohard about 6 years ago

Comportement à vérifier avec Joël : la vérification n’est pas effectuée au reconfigure.

Comportement confirmé par Joël.

#9 Updated by Scrum Master about 6 years ago

  • Status changed from Résolu to Fermé

Also available in: Atom PDF