Project

General

Profile

Scénario #29564

Faire fonctionner EoleDB sur EOLE 2.8.0 et le passer en python3

Added by Joël Cuissinat 2 months ago. Updated 17 days ago.

Status:
Terminé (Sprint)
Priority:
Normal
Assigned To:
Category:
-
Start date:
02/10/2020
Due date:
03/20/2020
% Done:

100%

Story points:
4.0
Remaining (hours):
0.00 hour
Velocity based estimate:
Release:
Release relationship:
Auto

Description

run-parts: executing /usr/share/eole/posttemplate/01-eoledb instance
Start Systemd service mysql [  OK  ]
/usr/bin/eole_db_gen:152: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. 
Please read https://msg.pyyaml.org/load for full details.
 conf = yaml.load(yml_conf)
'EoleDbConnector' object has no attribute 'dbtype'
'EoleDbConnector' object has no attribute 'dbtype'
Stop Systemd service mysql [  OK  ]

Solutions à mettre en œuvre

Critères d'acceptation


Subtasks

Tâche #29693: Passer le code en Python3FerméMatthieu Lamalle

Tâche #29694: Mettre à jour les requêtes SQLFerméMatthieu Lamalle


Related issues

Related to Distribution EOLE - Tâche #29713: Validation du scénario : Faire fonctionner EoleDB sur EOLE 2.8.0 et le passer en python3 Fermé 03/05/2020

Associated revisions

Revision 22c004a6 (diff)
Added by Joël Cuissinat 2 months ago

eole_db_gen : fix YAMLLoadWarning on EOLE 2.8.0

Ref: #29564

Revision 18c40f1b (diff)
Added by Joël Cuissinat 2 months ago

EoleDB : update imports for EOLE 2.8.0

Ref: #29564

History

#1 Updated by Joël Cuissinat 2 months ago

Visiblement pylint signale le soucis dès la 2.6.2 :

root@scribe:~# pylint /usr/lib/python2.7/dist-packages/eoledb/eoledbconnector.py 
No config file found, using default configuration
************* Module eoledb.eoledbconnector
W: 16, 0: Relative import 'eoledberrors', should be 'eoledb.eoledberrors' (relative-import)
W: 21, 4: Relative import 'eoledbsqlite', should be 'eoledb.eoledbsqlite' (relative-import)
W: 27, 4: Relative import 'eoledbpg', should be 'eoledb.eoledbpg' (relative-import)
W: 33, 4: Relative import 'eoledbmysql', should be 'eoledb.eoledbmysql' (relative-import)
C: 39, 0: Missing class docstring (missing-docstring)
E: 57,66: Instance of 'EoleDbConnector' has no 'dbtype' member (no-member)
R: 39, 0: Too few public methods (0/2) (too-few-public-methods)
W: 15, 0: Unused import yaml (unused-import)

-----------------------------------
Your code has been rated at 6.84/10

#2 Updated by Joël Cuissinat 2 months ago

Sur Scribe 2.8.0, on voit le problème car le backend MySQL n'arrive à se charger :

root@scribe:~# python /usr/lib/python2.7/dist-packages/eoledb/eoledbmysql.py 
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/eoledb/eoledbmysql.py", line 14, in <module>
    from _mysql_exceptions import OperationalError
ImportError: No module named _mysql_exceptions

Il faut remplacer cet import par :

from MySQLdb._exceptions import OperationalError

#3 Updated by Joël Cuissinat 2 months ago

  • Status changed from Nouveau to Résolu
  • Assigned To set to Joël Cuissinat
  • % Done changed from 0 to 100

#4 Updated by Joël Cuissinat 2 months ago

  • Status changed from Résolu to En cours

#5 Updated by Joël Cuissinat 2 months ago

C'est mieux mais pas suffisant car EoleDB est également sensé effectuer des "GRANT" sur les bases de données mais il utilise toujours les anciennes syntaxes !

--
eoledb/eoledbmysql.py-                if self.__userExists__(self.dbuser, self.dbhost) is False:
eoledb/eoledbmysql.py-                    req = "grant all privileges on {0}.*".format(self.dbname)
eoledb/eoledbmysql.py-                    req += " to '{0}'@'{1}'".format(self.dbuser, self.dbhost)
eoledb/eoledbmysql.py:                    req += " identified by '{0}'".format(self.dbpass)
--
eoledb/eoledbmysql.py-                if self.__userExists__(self.dbuser, host) is False:
eoledb/eoledbmysql.py-                    req = "grant all privileges on {0}.*".format(self.dbname)
eoledb/eoledbmysql.py-                    req += " to '{0}'@'{1}'".format(self.dbuser, host)
eoledb/eoledbmysql.py:                    req += " identified by '{0}';".format(self.dbpass)

Pour l'instant sur un Scribe 2.8.0, les utilisateurs sympa et roundcube ne sont tout simplement pas créés.

#6 Updated by Joël Cuissinat 2 months ago

  • Assigned To deleted (Joël Cuissinat)
  • Parent task deleted (#29463)

#7 Updated by Joël Cuissinat 2 months ago

  • Tracker changed from Tâche to Scénario
  • Due date set to 02/28/2020
  • Status changed from En cours to Nouveau
  • Target version changed from sprint 2020 04-06 Equipe MENSR to sprint 2020 07-09 Equipe MENSR
  • Start date changed from 02/05/2020 to 02/10/2020
  • % Done changed from 100 to 0
  • Release set to EOLE 2.8.0
  • Story points set to 4.0

#8 Updated by Joël Cuissinat 2 months ago

  • Target version changed from sprint 2020 07-09 Equipe MENSR to Prestation Cadoles MEN 10-12

#9 Updated by Joël Cuissinat about 2 months ago

  • Subject changed from Faire fonctionner EoleDB sur EOLE 2.8.0 to Faire fonctionner EoleDB sur EOLE 2.8.0 et le passer en python3
  • Description updated (diff)

#10 Updated by Joël Cuissinat about 2 months ago

  • Project changed from Distribution EOLE to eole-db

#11 Updated by Joël Cuissinat about 1 month ago

  • Related to Tâche #29713: Validation du scénario : Faire fonctionner EoleDB sur EOLE 2.8.0 et le passer en python3 added

#12 Updated by Joël Cuissinat about 1 month ago

  • Assigned To set to Matthieu Lamalle

#13 Updated by Joël Cuissinat 17 days ago

Plus d'erreur dans https://dev-eole.ac-dijon.fr/jenkins/job/2.8.0/job/test-instance-acascribe-2.8.0-amd64/ (job n°30) :

10:47:40             run-parts: executing /usr/share/eole/posttemplate/01-eoledb instance
10:47:46             Start Systemd service mysql                                             [  OK  ]
10:47:52             ROUNDCUBE :
10:47:52                 >>> Passwords     [OK]
10:47:52                 >>> Create      [OK]
10:48:04                 >>> Update      [OK]
10:48:04             SYMPA :
10:48:04                 >>> Passwords     [OK]
10:48:04                 >>> Create      [OK]
10:48:04                 >>> Update      [OK]
10:48:10             Stop Systemd service mysql                                              [  OK  ]

Les bases sympa et roundcube sont présentes :

root@scribe:~# echo "show databases" | mysql --defaults-file=/etc/mysql/debian.cnf
Database
bareos
controlevnc
information_schema
mysql
performance_schema
roundcube
sympa
sys

#14 Updated by Joël Cuissinat 17 days ago

  • Status changed from Nouveau to Terminé (Sprint)

Also available in: Atom PDF