Projet

Général

Profil

Bug #41132

Commande hobo_notify utilisant un fichier HS en python3

Ajouté par Nicolas Roche il y a environ 4 ans. Mis à jour il y a environ 4 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
-
Début:
28 mars 2020
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

Bug constaté en rejouant manuellement la notification des rôles via hobo-agent :

$ /usr/bin/wcsctl -f /etc/wcs/wcs.cfg hobo_notify /tmp/notify.json 
  File "/usr/lib/python3/dist-packages/wcs/ctl/hobo_notify.py", line 64, in load_notification
   return json.load(file(args[0]))
  NameError: name 'file' is not defined


Fichiers

Révisions associées

Révision d20db7a3 (diff)
Ajouté par Nicolas Roche il y a environ 4 ans

python3: replace file function by open (#41132)

Historique

#1

Mis à jour par Thomas Noël il y a environ 4 ans

  • Sujet changé de Comande hobo_notify utilisant un fichier HS en python3 à Commande hobo_notify utilisant un fichier HS en python3

(mignon, good catch... note qu'on l'avait jamais vu parce que Publik passe toujours par stdin)

#2

Mis à jour par Nicolas Roche il y a environ 4 ans

J'ai également corrigé les autres occurrences de la fonction file trouvées :

$ git grep '[ (]file('
tests/robot/WcsRobotFrameworkLibrary.py:        fd = file('/tmp/.tests/pid', 'w')
tests/robot/WcsRobotFrameworkLibrary.py:        fd = file('/tmp/.tests/pid')
wcs/qommon/static/images/categories/generate.py:        tree = ET.fromstring(file(svg_path).read().replace('#000000', '#%s' % options.colour))
wcs/qommon/static/images/categories/generate.py:        tree = ET.fromstring(file(svg_path).read())

#3

Mis à jour par Thomas Noël il y a environ 4 ans

  • Statut changé de Solution proposée à Solution validée
#4

Mis à jour par Frédéric Péters il y a environ 4 ans

  • Statut changé de Solution validée à Résolu (à déployer)

Poussée, nickel.

commit d20db7a3f7db48279c9eb6bc007fdb6b1ee9e894
Author: Nicolas ROCHE <nroche@entrouvert.com>
Date:   Sat Mar 28 20:50:48 2020 +0100

    python3: replace file function by open (#41132)
#5

Mis à jour par Frédéric Péters il y a environ 4 ans

  • Statut changé de Résolu (à déployer) à Solution déployée

Formats disponibles : Atom PDF