~arosales/charms/trusty/datameer/trunk

« back to all changes in this revision

Viewing changes to hooks/services.py

  • Committer: Antonio Rosales
  • Date: 2015-02-24 17:36:21 UTC
  • Revision ID: antonio.rosales@canonical.com-20150224173621-axjdwc682g82rdom
Create stub relations

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
from charmhelpers.core.services.base import ServiceManager
 
4
from charmhelpers.core.services import helpers
 
5
 
 
6
import actions
 
7
 
 
8
 
 
9
def manage():
 
10
    manager = ServiceManager([
 
11
        {
 
12
            'service': 'apache-hue',
 
13
            'ports': [],  # ports to after start
 
14
            'provided_data': [
 
15
                # context managers for provided relations
 
16
                # e.g.: helpers.HttpRelation()
 
17
            ],
 
18
            'required_data': [
 
19
                # data (contexts) required to start the service
 
20
                # e.g.: helpers.RequiredConfig('domain', 'auth_key'),
 
21
                #       helpers.MysqlRelation(),
 
22
            ],
 
23
            'data_ready': [
 
24
                helpers.render_template(
 
25
                    source='upstart.conf',
 
26
                    target='/etc/init/apache-hue'),
 
27
                actions.log_start,
 
28
            ],
 
29
        },
 
30
    ])
 
31
    manager.manage()