~bigdata-charmers/charms/trusty/hdp-tez/trunk

« back to all changes in this revision

Viewing changes to hooks/stop

  • Committer: amir sanjar
  • Date: 2014-09-17 03:03:54 UTC
  • Revision ID: amir.sanjar@canonical.com-20140917030354-ap11m9367vbfdr5t
adding amulet test

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python
2
 
 
3
 
import os
4
 
import sys
5
 
 
6
 
sys.path.insert(0, os.path.join(os.environ['CHARM_DIR'], 'lib'))
7
 
 
8
 
from charmhelpers.core import (
9
 
    hookenv,
10
 
    host,
11
 
)
12
 
 
13
 
hooks = hookenv.Hooks()
14
 
log = hookenv.log
15
 
 
16
 
SERVICE = 'hdp-tez'
17
 
 
18
 
 
19
 
@hooks.hook('stop')
20
 
def stop():
21
 
    host.service_stop(SERVICE)
22
 
 
23
 
 
24
 
if __name__ == "__main__":
25
 
    # execute a hook based on the name the program is called by
26
 
    hooks.execute(sys.argv)