From 3d9b9e40d42b5ea6ec0925a60d2e5cd9f31c413c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 31 Aug 2016 16:03:45 +0200 Subject: [PATCH] Added PillarExtension.setup_app(app) It's called on each extension after all extensions have been processed, and after all built-in Pillar modules have had their setup_app() called. Call order is random. --- pillar/__init__.py | 4 ++++ pillar/extension.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/pillar/__init__.py b/pillar/__init__.py index 1973df82..77c46173 100644 --- a/pillar/__init__.py +++ b/pillar/__init__.py @@ -284,6 +284,10 @@ class PillarServer(Eve): web.setup_app(self) authentication.setup_app(self) + for ext in self.pillar_extensions.itervalues(): + self.log.info('Setting up extension %s', ext.name) + ext.setup_app(self) + self._config_jinja_env() self._config_static_dirs() diff --git a/pillar/extension.py b/pillar/extension.py index 22b8c759..0c7b3e3a 100644 --- a/pillar/extension.py +++ b/pillar/extension.py @@ -62,3 +62,6 @@ class PillarExtension(object): :rtype: dict """ + + def setup_app(self, app): + """Called during app startup, after all extensions have loaded."""