Cruise won't load on Django backend when loggers share a config name

Aperta
#758 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
django, python

Direzione di ricerca

Start by reading _get_logger_config_object_by_name() and set_active_logger_config in the Django backend, then inspect TestDjangoServerAPI.test_basic and how the NBP1406 cruise defines logger configs. Reproduce the failure with shared config names and confirm the lookup distinguishes configs by logger. Done when the Django backend loads that cruise and the test passes.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hi Webb and Pablo! I ran into this while running the test suite on dev.

If a cruise file gives several loggers a config with the same name (say, every logger has an off config), the Django backend can't load it. It fails in set_active_logger_config with MultipleObjectsReturned.

From what I can tell, _get_logger_config_object_by_name() looks configs up by name alone. If config names are meant to be unique only within a logger (the test cruise seems to assume so), a shared name matches more than one row.

This is also why TestDjangoServerAPI.test_basic fails on both dev and master right now.

Easy way to see it: take the NBP1406 cruise and rename each logger's configs to shared names like off / net / net+file, then load it with the Django backend. The shipped NBP1406 file works fine since its names are unique.

I have a small fix that scopes the lookup to the logger, with a test. Happy to open a PR against dev if that sounds right to you.

Lingua principale
Python
Stelle
57
Fork
30
Merge medio
3h 14m
PR unite (30g)
56

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OceanDataTools/openrvdas

Tutte le issue di OceanDataTools/openrvdas

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.