~openstack-charmers-next/charms/precise/ceph-mon/trunk

« back to all changes in this revision

Viewing changes to actions/pool-statistics.py

  • Committer: Chris Holcombe
  • Date: 2016-06-29 23:01:40 UTC
  • Revision ID: xfactor973@gmail.com-20160629230140-5zracms49l25x8id
Symlink Actions

This change symlinks the python actions files so that tox
can properly test the code.

Change-Id: Ib6d070555535dc202735124afdafa8dd401350df

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
import sys
 
3
 
 
4
sys.path.append('hooks')
 
5
from subprocess import check_output, CalledProcessError
 
6
from charmhelpers.core.hookenv import log, action_set, action_fail
 
7
 
 
8
if __name__ == '__main__':
 
9
    try:
 
10
        out = check_output(['ceph', '--id', 'admin',
 
11
                            'df']).decode('UTF-8')
 
12
        action_set({'message': out})
 
13
    except CalledProcessError as e:
 
14
        log(e)
 
15
        action_fail("ceph df failed with message: {}".format(e.message))