Bug 629076 - schema doesn't enforce not null on watchdog system_id.
Summary: schema doesn't enforce not null on watchdog system_id.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: scheduler
Version: 0.5
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Bill Peck
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 632609
TreeView+ depends on / blocked
 
Reported: 2010-08-31 20:40 UTC by Bill Peck
Modified: 2011-09-28 15:34 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-09-17 02:19:58 UTC
Embargoed:


Attachments (Terms of Use)

Description Bill Peck 2010-08-31 20:40:00 UTC
Description of problem:
I don't know how it happens but sometimes we get watchdog records with a null system_id.  This should not happen.  


Proposed patch:
diff --git a/Server/bkr/server/model.py b/Server/bkr/server/model.py
index bf91c77..4622625 100644
--- a/Server/bkr/server/model.py
+++ b/Server/bkr/server/model.py
@@ -206,7 +206,7 @@ labinfo_table = Table('labinfo', metadata,
 watchdog_table = Table('watchdog', metadata,
     Column('id', Integer, autoincrement=True,
            nullable=False, primary_key=True),
-    Column('system_id', Integer, ForeignKey('system.id')),
+    Column('system_id', Integer, ForeignKey('system.id'), nullable=False),
     Column('recipe_id', Integer, ForeignKey('recipe.id')),
     Column('recipetask_id', Integer, ForeignKey('recipe_task.id')),
     Column('subtask', Unicode(255)),

Comment 1 Bill Peck 2010-08-31 20:42:06 UTC
This will need an update to the existing DB for it to be active.


Note You need to log in before you can comment on or make changes to this bug.