Bug 13138

Summary: srtool_update throws exception
Product: [Yocto Project Subprojects] Security Response Tool Reporter: Ross Burton <ross.burton>
Component: GeneralAssignee: David Reyna <david.reyna>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium    
Version: unspecified   
Target Milestone: 2.7 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ross Burton 2019-01-14 11:51:05 UTC
I've just started srtool with current master so the migrations have all happened, but srtool_update fails:

$ ./bin/common/srtool_update.py  -u
BEGINNING UPDATING DATASOURCES... this MAY take a long time
time_now = 2019-01-14 11:48:53
Traceback (most recent call last):
  File "./bin/common/srtool_update.py", line 265, in <module>
    main(sys.argv[1:])
  File "./bin/common/srtool_update.py", line 242, in main
    run_updates(args.force,name_filter,args.is_trial)
  File "./bin/common/srtool_update.py", line 137, in run_updates
    if ORM.DATASOURCE_MINUTELY == update_frequency:
AttributeError: type object 'ORM' has no attribute 'DATASOURCE_MINUTELY'
Comment 1 David Reyna 2019-01-14 11:58:38 UTC
Workaround:

  bin/common/srtool_common.py --generate-schema-header

The root cause is that I added new ORM defines in a recent commit, but they are not seen yet in your headers.

I will fix this data source so that it updates the headers each time you restart the application, so that this will not happen in the future.
Comment 2 Ross Burton 2019-01-14 12:01:44 UTC
Confirmed, thanks
Comment 3 David Reyna 2019-01-14 23:50:02 UTC
commit 959cc8196aab2231b7f6f05c7e0151f8de46ea48

Set the schema generator to always update on startup.

To apply:

  $ ./stop.sh
  $ git pull
  $ ./start.sh