maas_url not returned to the UI
Bug #1926140 reported by
Alberto Donato
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Medium
|
Björn Tillenius |
Bug Description
The config.list websocket handler always returns "http://
Currently the MAAS url selected at init time is only written to the regiond.conf file, not to the database.
The config websocket handler module has some code to add it from reading it there, but it's not actually used.
Also, the value is only read at startup, and might be set to different values on different controllers.
I think we should have the value set in the database, and fall back to the request url if it isn't (e.g. if you have multiple controllers with no reverseproxy in front)
Related branches
~bjornt/maas:bug-1926140-maas-url-db
Merged
into
maas:master
- Alberto Donato (community): Approve
-
Diff: 336 lines (+151/-63)4 files modifiedsrc/maasserver/start_up.py (+4/-0)
src/maasserver/tests/test_start_up.py (+26/-0)
src/maasserver/websockets/handlers/config.py (+27/-30)
src/maasserver/websockets/handlers/tests/test_config.py (+94/-33)
Changed in maas: | |
assignee: | nobody → Björn Tillenius (bjornt) |
status: | Triaged → In Progress |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
The issue is that websocket handler (maasserver/ websocket/ handlers/ config. py) tries to add the maas_url from regiond.conf to CONFIG_ITEMS. But the problem is that CONFIG_ITEMS only defines which config items are editable, it doesn't define the actual values.
So later on, the handler reads all the keys from CONFIG_ITEMS, but then reads the value from the database (which won't exist and return the default "localhost").
Eventually, we want to remove maas_url from regiond.conf and have it in the database, since maas_url is meant to specify the public URL to the MAAS deployment.
Deprecating maas_url in regiond.conf might be bit tricky, but for now we could have the region sync the value to the database. That would fix this bug, and then we can deal with deprecating maas_url in regiond.conf later.
Considering this should be an easy fix, let's try to get this done for 3.0.