Bug 629076

Summary: schema doesn't enforce not null on watchdog system_id.
Product: [Retired] Beaker Reporter: Bill Peck <bpeck>
Component: schedulerAssignee: Bill Peck <bpeck>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: 0.5CC: bpeck, dcallagh, kbaker, mcsontos, rmancy
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-09-17 02:19:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 632609    

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.