Commits

Christian Theune committed fe8e5ca

Replace old "hook" mechanism with the new provide/require feature.

Comments (0)

Files changed (4)

components/django/component.py

 
 class Django(Component):
 
-    _hooks = {'supervisor': None}
-
     def configure(self):
         buildout_cfg = File('buildout.cfg', is_template=True)
         self += Buildout(python='2.7', config=buildout_cfg)
 
-        self.hooks['supervisor'] = (
+        self.db = self.require('database:django')
+
+        self.provide('supervisor',
             '30 django (startsecs=3) {0}/bin/django-admin '
             '[runserver --settings=sprintsite.settings]'
             .format(self.root.workdir))

components/supervisor/component.py

     http_port = Address('localhost:9001')
 
     def configure(self):
-        self.programs = self.find_hooks('supervisor', self.host)
+        # XXX limit by host!
+        self.programs = self.require('supervisor')
         self += Buildout(
             python='2.7',
             config=File('buildout.cfg', is_template=True))

environments/dev-ctheune.cfg

 host_domain =
 
 [hosts]
-localhost = django, supervisor
+localhost = supervisor, django

environments/test.cfg

 service_user = test2
 
 [hosts]
-test02 = django, supervisor
+test02 = cms, supervisor