~thomir-deactivatedaccount/charms/trusty/tanuki-result-enum-worker/trunk

« back to all changes in this revision

Viewing changes to hooks/services.py

  • Committer: Thomi Richards
  • Date: 2015-07-21 21:02:25 UTC
  • mfrom: (22.2.12 result-enum-worker-charm)
  • Revision ID: thomi.richards@canonical.com-20150721210225-jq0fs0v2caehh0aw
Merge code to deal with mongodb relation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python
 
1
#!/usr/bin/python3
2
2
 
3
3
from charmhelpers.core import hookenv
4
4
from charmhelpers.core.services.base import ServiceManager
7
7
import actions
8
8
 
9
9
 
 
10
class MongoRelation(helpers.RelationContext):
 
11
 
 
12
    name = 'mongodb'
 
13
    interface = 'mongodb'
 
14
 
 
15
 
10
16
def manage():
11
17
    config = hookenv.config()
12
18
    manager = ServiceManager([
13
19
        {
14
20
            'service': 'result-enum-worker',
15
 
            'required_data': [config],
 
21
            'required_data': [config, MongoRelation()],
16
22
            'data_ready': [
17
23
                actions.basenode,
18
24
                actions.install_packages,