Fixing API setup with new plugin "config spec" world
authorChristopher Allan Webber <cwebber@dustycloud.org>
Wed, 8 May 2013 20:20:27 +0000 (15:20 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Wed, 8 May 2013 20:20:27 +0000 (15:20 -0500)
It shouldn't reference the config until in the setup_plugin() method,
else there's a race condition.

mediagoblin/plugins/api/__init__.py

index d3fdf2ef6723d166fc7922fce72206d7778c9969..1eddd9e0612c14cbb31fad9dc8f84f11944138b2 100644 (file)
@@ -23,11 +23,11 @@ _log = logging.getLogger(__name__)
 
 PLUGIN_DIR = os.path.dirname(__file__)
 
-config = pluginapi.get_config(__name__)
-
 def setup_plugin():
     _log.info('Setting up API...')
 
+    config = pluginapi.get_config(__name__)
+
     _log.debug('API config: {0}'.format(config))
 
     routes = [