Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
shirosaidev committed Dec 12, 2023
1 parent cb4d35c commit e315bfd
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 26 deletions.
7 changes: 7 additions & 0 deletions diskover/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Diskover v2 Community Edition Change Log

# [2.2.2] - 2023-12-12
### added
- index gets deleted if diskover.py exits with critical error
### fixed
- moved plugin init call below create_index() so we can access the current index


# [2.2.1] - 2023-11-03
### changed
- version change only
Expand Down
43 changes: 17 additions & 26 deletions diskover/diskover.py
Original file line number Diff line number Diff line change
Expand Up @@ -1332,37 +1332,28 @@ def log_setup():
logger.info('Config file: {0}'.format(config_filename))
logger.info('Config env var DISKOVERDIR: {0}'.format(os.getenv('DISKOVERDIR')))

# print plugins
if plugins_enabled and plugins:
plugins_list = ''
for pi in get_plugins_info():
plugins_list = plugins_list + pi['name'] + ' '
logger.info('Plugins loaded: {0}'.format(plugins_list))
else:
logger.info('No plugins loaded')

# init and print plugins
if plugins_enabled and plugins:
for plugin in plugins:
if hasattr(plugin, 'init'):
try:
plugin.init(globals())
except Exception as e:
raise PluginError(e)
# print plugins
if plugins_enabled and plugins:
plugins_list = ''
for pi in get_plugins_info():
plugins_list = plugins_list + pi['name'] + ' '
logger.info('Plugins loaded: {0}'.format(plugins_list))
else:
logger.info('No plugins loaded')

try:
logger.info('Creating index {0}...'.format(options.index))
create_index(options.index, es)

tune_index(es, options.index)

# init plugins
if plugins_enabled and plugins:
for plugin in plugins:
if hasattr(plugin, 'init'):
try:
plugin.init(globals())
except Exception as e:
raise PluginError(e)
# print plugins
if plugins_enabled and plugins:
plugins_list = ''
for pi in get_plugins_info():
plugins_list = plugins_list + pi['name'] + ' '
logger.info('Plugins loaded: {0}'.format(plugins_list))
else:
logger.info('No plugins loaded')

# check for thread config override
if options.threads:
Expand Down

0 comments on commit e315bfd

Please sign in to comment.