~verterok/charms/trusty/tanuki-result-enum-api/set-as-nrpe-primary

« back to all changes in this revision

Viewing changes to hooks/nrpe-external-master-relation-joined

  • Committer: Guillermo Gonzalez
  • Date: 2015-10-01 21:42:25 UTC
  • Revision ID: guillermo.gonzalez@canonical.com-20151001214225-x9xlah2u96e0919w
add nrpe-external-master-relation-joined hook to set the service unit as the primary relation

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
from charmhelpers.core import hookenv
 
4
 
 
5
 
 
6
def nrpe_external_master_relation_joined():
 
7
    '''Set us as the primary relation'''
 
8
    rel_id = hookenv.relation_id()
 
9
    hookenv.relation_set(rel_id, primary=True)
 
10
 
 
11
 
 
12
if __name__ == '__main__':
 
13
    nrpe_external_master_relation_joined()