Projet

Général

Profil

Tâche #18676

Scénario #18693: Traitement express MEN (4-6)

Erreur creolelint Amonecole 2.6.1a3 (lxc)

Ajouté par Gilles Grandgérard il y a plus de 7 ans. Mis à jour il y a environ 7 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Début:
08/11/2016
Echéance:
% réalisé:

100%

Temps estimé:
1.00 h
Temps passé:
Restant à faire (heures):
0.0

Description

00:21:50.458              \-- /usr/share/eole/creole/distrib/lxc.devices.hook
00:38:02.742             Exception ctypes.ArgumentError: "argument 1: <type 'exceptions.TypeError'>: expected LP_udev_enumerate instance instead of Enumerator" in <bound method Enumerator.__del__ of <pyudev.core.Enumerator object at 0x7f18b3db91d0>> ignored
00:38:02.743             Exception ctypes.ArgumentError: "argument 1: <type 'exceptions.TypeError'>: expected LP_udev_enumerate instance instead of Enumerator" in <bound method Enumerator.__del__ of <pyudev.core.Enumerator object at 0x7f18b3db92d0>> ignored
00:38:02.743             Exception ctypes.ArgumentError: "argument 1: <type 'exceptions.RuntimeError'>: maximum recursion depth exceeded while calling a Python object" in <bound method Enumerator.__del__ of <pyudev.core.Enumerator object at 0x7f18b3db93d0>> ignored
00:38:02.744             Exception ctypes.ArgumentError: "argument 1: <type 'exceptions.RuntimeError'>: maximum recursion depth exceeded while calling a Python object" in <bound method Context.__del__ of <pyudev.core.Context object at 0x7f18b3db9310>> ignored
00:38:02.744             AUTOMATE : Traceback dans la sortie console!
00:38:02.744             Traceback (most recent call last):
00:38:02.745               File "/usr/bin/CreoleLint", line 60, in main
00:38:02.745                 validate(keyword, ansi, tmpl)
00:38:02.748               File "/usr/lib/python2.7/dist-packages/creole/lint/creolelint.py", line 1167, in validate
00:38:02.749                 ansi.process(cl)
00:38:02.749               File "/usr/lib/python2.7/dist-packages/creole/lint/ansiwriter.py", line 47, in process
00:38:02.749                 checks = linter.check()
00:38:02.751               File "/usr/lib/python2.7/dist-packages/creole/lint/creolelint.py", line 1126, in check
00:38:02.751                 parse_templates(self._list_tmpl_files())
00:38:02.752               File "/usr/lib/python2.7/dist-packages/creole/lint/parsetemplate.py", line 633, in parse_templates
00:38:02.752                 print_red(str(err))
00:38:02.753             RuntimeError: maximum recursion depth exceeded while getting the repr of a tuple

Révisions associées

Révision bdc8dd60 (diff)
Ajouté par Philippe Caseiro il y a environ 7 ans

Correction du template lxc.devices.hook

Le "current_container" n'a pas forcément de disknods.
C'est ce qui fait planté CreoleLint ... il n'y a donc pas
de bug dans CreoleLint ...

ref #18676 @2h

Révision d04fc089 (diff)
Ajouté par Daniel Dehennin il y a environ 7 ans

Protect access to containers attributes

Some container's attributes are not present, checking the length of
such an attribute result in

“RuntimeError: maximum recursion depth exceeded while getting the repr of a tuple”

We need to protect access to such attributes, but the following does
not work:

%if 'attributes' in %%current_container

we need to explicitely use “%%hasattr”.

  • tmpl/lxc.config: Protect access to “disknods”.
  • tmpl/lxc.fstab: Protect access to “fstabs”.
  • tmpl/lxc.devices.hook: Use single quote.

Ref: #18676

Révision 0127d8ef (diff)
Ajouté par Daniel Dehennin il y a environ 7 ans

Template: check element existence in context with “in”

It's not possible to make:

%if 'fstabs' in %%current_container

Because the “CreoleGet” object does not implements the
“__contains__()” method.

  • creole/template.py (CreoleGet.__contains__): Check variable
    existence in context.

Ref: #18676

Révision 6e59d31d (diff)
Ajouté par Daniel Dehennin il y a environ 7 ans

Fix protection of access to containers attributes

We need to protect access to such attributes, but they are not
attributes of the object %%current_context.

“creole.template.CreoleGet” is fixed to make the use of “in” possible.

  • tmpl/lxc.config: Check existence of “disknods” in
    “%%current_container”.
  • tmpl/lxc.devices.hook: Check existence of “disknods” in
    “%%current_container”.
  • tmpl/lxc.fstab: Check existence of “fstabs” in
    “%%current_container”.

Ref: #18676

Révision 4393e590 (diff)
Ajouté par Daniel Dehennin il y a environ 7 ans

LXC: fix “UnicodeEncodeError” on /etc/hosts generation

Concatening an unicode with a non unicode can result in “UnicodeEncodeError”.

  • creole/funcs/get_etc_hosts.py (get_etc_hosts): Add unicode to
    inlined strings.

Ref: #18676

Révision f02f5d37 (diff)
Ajouté par Daniel Dehennin il y a environ 7 ans

LXC: fix comment on container interface

  • creole/funcs/get_etc_hosts.py (get_etc_hosts): Remove plural form
    for single interface.

Ref: #18676

Révision c745d69b (diff)
Ajouté par Daniel Dehennin il y a environ 7 ans

CreoleLint: LXC must contains resources

Some templates use “%%current_container” to access container resources
like “interfaces”, “disknods”, “hosts”, “fstabs”...

Protecting access in template is useless because CreoleLint did not
use the correct method to build container context.

  • creole/lint/parsetemplate.py (Check_Template.__init__): Use
    “CreoleClient.get_container_info()”.

Ref: #18676

Historique

#2 Mis à jour par Gérald Schwartzmann il y a plus de 7 ans

  • Tâche parente changé de #18373 à #18693

#3 Mis à jour par Philippe Caseiro il y a environ 7 ans

  • Assigné à mis à Philippe Caseiro

#4 Mis à jour par Scrum Master il y a environ 7 ans

  • Statut changé de Nouveau à En cours

#5 Mis à jour par Scrum Master il y a environ 7 ans

  • Statut changé de En cours à Résolu

#6 Mis à jour par Daniel Dehennin il y a environ 7 ans

  • Statut changé de Résolu à En cours

#7 Mis à jour par Daniel Dehennin il y a environ 7 ans

  • Assigné à changé de Philippe Caseiro à Daniel Dehennin

Le problème est présent sur d’autres templates.

#8 Mis à jour par Daniel Dehennin il y a environ 7 ans

  • Statut changé de En cours à Résolu

Nouveau paquet 2.6.1-52.

#9 Mis à jour par Daniel Dehennin il y a environ 7 ans

  • % réalisé changé de 0 à 100

#10 Mis à jour par Daniel Dehennin il y a environ 7 ans

Pas de plantage au CreoleLint sur jenkins.

#11 Mis à jour par Daniel Dehennin il y a environ 7 ans

  • Statut changé de Résolu à Fermé
  • Restant à faire (heures) changé de 1.0 à 0.0

Formats disponibles : Atom PDF