Bug 13138 - srtool_update throws exception
Summary: srtool_update throws exception
Status: RESOLVED FIXED
Alias: None
Product: Security Response Tool
Classification: Yocto Project Subprojects
Component: General (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.7 M2
Assignee: David Reyna
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2019-01-14 11:51 UTC by Ross Burton
Modified: 2019-01-22 21:11 UTC (History)
0 users

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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