geenforce: let a kiosk say what it is instead of guessing
A display knows whether it is a Dashboard, a Lobby screen or the 3D print room - the dispatcher reads C:\Enrollment\display-type.txt to choose which page to open. It never told shopdb, so the fleet table inferred it from the DashboardDefault fqdn mapping, which is empty unless somebody added a row per kiosk. The column was blank for every display. The client now reads that file and reports it, the report stores it, and the API prefers the reported value with the old mapping left as a fallback for hosts still on an older client. Reported by the device beats inferred from a lookup table, the same way enforcerversion already works. A PC with no display-type.txt reports nothing rather than something invented, and an empty string lands as NULL. Two guards had to learn about it. The DDL parity check read only the 0001 baseline, so a column added by a later revision looked like drift even though its migration existed; it now runs the whole chain, which is what 'do the models match what the migrations build' means. 0002 added a whole table rather than a column, which is why this is the first time it bit.
This commit is contained in:
28
plugins/geenforce/migrations/versions/0003_report_subtype.py
Normal file
28
plugins/geenforce/migrations/versions/0003_report_subtype.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""Record the display subtype a PC reports for itself.
|
||||
|
||||
A kiosk knows whether it is a Dashboard, Lobby or 3DPrintRoom - the dispatcher
|
||||
reads C:\\Enrollment\\display-type.txt to pick its target - but it never told
|
||||
ShopDB, so the reports table had to infer it from the DashboardDefault
|
||||
fqdn/ip mapping, which is blank unless someone added a row per kiosk. Reported
|
||||
by the device beats inferred from a mapping table, the same way enforcerversion
|
||||
already works.
|
||||
|
||||
Revision ID: geenforce0003subtype
|
||||
Revises: geenforce0002blobs
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
revision = 'geenforce0003subtype'
|
||||
down_revision = 'geenforce0002blobs'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.add_column('manifestenforcementreports',
|
||||
sa.Column('subtype', sa.String(length=50), nullable=True))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_column('manifestenforcementreports', 'subtype')
|
||||
Reference in New Issue
Block a user