#!/usr/bin/python from subprocess import CalledProcessError __author__ = 'chris' import sys sys.path.append('hooks') from charmhelpers.contrib.storage.linux.ceph import remove_erasure_profile from charmhelpers.core.hookenv import action_get, log, action_fail def delete_erasure_profile(): name = action_get("name") try: remove_erasure_profile(service='admin', profile_name=name) except CalledProcessError as e: action_fail("Remove erasure profile failed with error: {}".format( e.message)) if __name__ == '__main__': delete_erasure_profile()