Skip to content

Commit

Permalink
Add minimal updater function
Browse files Browse the repository at this point in the history
  • Loading branch information
PidgeyL committed Nov 6, 2015
1 parent 7f119c1 commit 35dd559
Showing 1 changed file with 23 additions and 20 deletions.
43 changes: 23 additions & 20 deletions sbin/db_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,8 @@
{'name': "cpe",
'updater': "python3 " + os.path.join(runPath, "db_mgmt_cpe_dictionary.py")},
{'name': "cpeother",
'updater': "python3 " + os.path.join(runPath, "db_mgmt_cpe_other_dictionary.py")},
{'name': 'vfeed',
'updater': "python3 " + os.path.join(runPath, "db_mgmt_vfeed.py")},
{'name': 'vendor',
'updater': "python3 " + os.path.join(runPath, "db_mgmt_vendorstatements.py")},
{'name': 'cwe',
'updater': "python3 " + os.path.join(runPath, "db_mgmt_cwe.py")},
{'name': 'capec',
'updater': "python3 " + os.path.join(runPath, "db_mgmt_capec.py")},
{'name': 'redis-cache-cpe',
'updater': "python3 " + os.path.join(runPath, "db_cpe_browser.py")},
{'name': 'd2sec',
'updater': "python3 " + os.path.join(runPath, "db_mgmt_d2sec.py")},
{'name': 'ms',
'updater': "python3 " + os.path.join(runPath, "db_mgmt_ms.py")},
{'name': 'redis-nist-ref',
'updater': "python3 " + os.path.join(runPath, "db_mgmt_ref.py")},
{'name': 'exploitdb',
'updater': "python3 " + os.path.join(runPath, "db_mgmt_exploitdb.py")}
]
'updater': "python3 " + os.path.join(runPath, "db_mgmt_cpe_other_dictionary.py")}]

posts = [{'name': "ensureindex",
'updater': "python3 " + os.path.join(runPath, "db_mgmt_create_index.py")}]

Expand All @@ -57,8 +39,29 @@
argParser.add_argument('-i', action='store_true', help='Indexing new cves entries in the fulltext indexer', default=False)
argParser.add_argument('-c', action='store_true', help='Enable CPE redis cache', default=False)
argParser.add_argument('-f', action='store_true', help='Drop collections and force initial import', default=False)
argParser.add_argument('-m', action='store_true', help='Minimal import', default=False)
args = argParser.parse_args()

if not args.m:
sources.extend([{'name': 'vfeed',
'updater': "python3 " + os.path.join(runPath, "db_mgmt_vfeed.py")},
{'name': 'vendor',
'updater': "python3 " + os.path.join(runPath, "db_mgmt_vendorstatements.py")},
{'name': 'cwe',
'updater': "python3 " + os.path.join(runPath, "db_mgmt_cwe.py")},
{'name': 'capec',
'updater': "python3 " + os.path.join(runPath, "db_mgmt_capec.py")},
{'name': 'redis-cache-cpe',
'updater': "python3 " + os.path.join(runPath, "db_cpe_browser.py")},
{'name': 'd2sec',
'updater': "python3 " + os.path.join(runPath, "db_mgmt_d2sec.py")},
{'name': 'ms',
'updater': "python3 " + os.path.join(runPath, "db_mgmt_ms.py")},
{'name': 'redis-nist-ref',
'updater': "python3 " + os.path.join(runPath, "db_mgmt_ref.py")},
{'name': 'exploitdb',
'updater': "python3 " + os.path.join(runPath, "db_mgmt_exploitdb.py")}])

if args.f and args.l:
print ("Drop collections and running in loop should not be used.")
argParser.print_help()
Expand Down

0 comments on commit 35dd559

Please sign in to comment.