~kos.tsakalozos/charms/trusty/hdp-storm/trunk

« back to all changes in this revision

Viewing changes to hooks/start

  • Committer: amir sanjar
  • Date: 2014-09-17 00:31:34 UTC
  • Revision ID: amir.sanjar@canonical.com-20140917003134-qzvpp37bw9rghw0h
Review update

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 = "supervisor"
17
 
 
18
 
 
19
 
@hooks.hook('start')
20
 
def start():
21
 
    log('Starting hdp-storm')
22
 
    #host.service_restart(SERVICE)
23
 
 
24
 
 
25
 
if __name__ == "__main__":
26
 
    # execute a hook based on the name the program is called by
27
 
    hooks.execute(sys.argv)