From f02da72993eb8e5a34ed049bad442c6d6db4701a Mon Sep 17 00:00:00 2001 From: Stuart Mackie Date: Wed, 19 Oct 2016 14:29:38 -0700 Subject: Removed cassandra charm. Will fetch in fetch-charms.sh in joid Change-Id: I668ca30b3b76fc2107045907be5b6010a552e6a9 Signed-off-by: Stuart Mackie --- charms/trusty/cassandra/hooks/hooks.py | 61 ---------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 charms/trusty/cassandra/hooks/hooks.py (limited to 'charms/trusty/cassandra/hooks/hooks.py') diff --git a/charms/trusty/cassandra/hooks/hooks.py b/charms/trusty/cassandra/hooks/hooks.py deleted file mode 100644 index e5b64ed..0000000 --- a/charms/trusty/cassandra/hooks/hooks.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/python3 -# Copyright 2015 Canonical Ltd. -# -# This file is part of the Cassandra Charm for Juju. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 3, as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranties of -# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR -# PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -from charmhelpers import fetch -from charmhelpers.core import hookenv - - -def set_proxy(): - import os - config = hookenv.config() - if config['http_proxy']: - os.environ['ftp_proxy'] = config['http_proxy'] - os.environ['http_proxy'] = config['http_proxy'] - os.environ['https_proxy'] = config['http_proxy'] - - -def bootstrap(): - try: - import bcrypt # NOQA: flake8 - import cassandra # NOQA: flake8 - except ImportError: - packages = ['python3-bcrypt', 'python3-cassandra'] - set_proxy() - fetch.configure_sources(update=True) - fetch.apt_install(packages, fatal=True) - import bcrypt # NOQA: flake8 - import cassandra # NOQA: flake8 - - -def default_hook(): - if not hookenv.has_juju_version('1.24'): - hookenv.status_set('blocked', 'Requires Juju 1.24 or higher') - # Error state, since we don't have 1.24 to give a nice blocked state. - raise SystemExit(1) - - # These need to be imported after bootstrap() or required Python - # packages may not have been installed. - import definitions - - # Only useful for debugging, or perhaps have this enabled with a config - # option? - # from loglog import loglog - # loglog('/var/log/cassandra/system.log', prefix='C*: ') - - hookenv.log('*** {} Hook Start'.format(hookenv.hook_name())) - sm = definitions.get_service_manager() - sm.manage() - hookenv.log('*** {} Hook Done'.format(hookenv.hook_name())) -- cgit 1.2.3-korg