Suppress error message when NDA plugins directory does not exists.

This commit is contained in:
Jean-Paul Chaput 2021-11-28 19:40:59 +01:00
parent b1b67d18e6
commit f954f69574
1 changed files with 8 additions and 5 deletions

View File

@ -250,12 +250,15 @@ def staticInitialization ():
if helpers.ndaTopDir: if helpers.ndaTopDir:
vprint( 1, ' o Preload NDA protected plugins.' ) vprint( 1, ' o Preload NDA protected plugins.' )
pluginsDir = os.path.join( helpers.ndaTopDir, 'python{}.{}/site-packages/cumulus/plugins' \ pythonDir =os.path.join( helpers.ndaTopDir, 'python{}.{}'.format( sys.version_info.major
.format( sys.version_info.major
, sys.version_info.minor )) , sys.version_info.minor ))
if os.path.isdir(pythonDir):
pluginsDir = os.path.join( pythonDir, 'site-packages/cumulus/plugins' )
loadPlugins( pluginsDir ) loadPlugins( pluginsDir )
else: else:
vprint( 1, ' o No NDA protected plugins.' ) vprint( 1, ' - No NDA protected plugins directory.' )
else:
vprint( 1, ' - No NDA protected plugins.' )
except Exception as e: except Exception as e:
helpers.showPythonTrace( __file__, e ) helpers.showPythonTrace( __file__, e )
loaded = True loaded = True