[cli] Setup logging to unsilence stevedore errors, like failing to load an entrypoint.
This commit is contained in:
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
|||||||
# This file has been auto-generated.
|
# This file has been auto-generated.
|
||||||
# All changes will be lost, see Projectfile.
|
# All changes will be lost, see Projectfile.
|
||||||
#
|
#
|
||||||
# Updated at 2017-05-28 18:02:16.552433
|
# Updated at 2017-05-28 22:04:19.262686
|
||||||
|
|
||||||
PACKAGE ?= bonobo
|
PACKAGE ?= bonobo
|
||||||
PYTHON ?= $(shell which python)
|
PYTHON ?= $(shell which python)
|
||||||
|
|||||||
@ -5,6 +5,7 @@ from stevedore import ExtensionManager
|
|||||||
|
|
||||||
|
|
||||||
def entrypoint(args=None):
|
def entrypoint(args=None):
|
||||||
|
logging.basicConfig()
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
|
|
||||||
subparsers = parser.add_subparsers(dest='command')
|
subparsers = parser.add_subparsers(dest='command')
|
||||||
@ -19,9 +20,7 @@ def entrypoint(args=None):
|
|||||||
except Exception:
|
except Exception:
|
||||||
logging.exception('Error while loading command {}.'.format(ext.name))
|
logging.exception('Error while loading command {}.'.format(ext.name))
|
||||||
|
|
||||||
mgr = ExtensionManager(
|
mgr = ExtensionManager(namespace='bonobo.commands')
|
||||||
namespace='bonobo.commands',
|
|
||||||
)
|
|
||||||
mgr.map(register_extension)
|
mgr.map(register_extension)
|
||||||
|
|
||||||
args = parser.parse_args(args).__dict__
|
args = parser.parse_args(args).__dict__
|
||||||
|
|||||||
Reference in New Issue
Block a user