summaryrefslogtreecommitdiffstats
path: root/charms/trusty/cassandra/hooks/hooks.py
diff options
context:
space:
mode:
authorStuart Mackie <wsmackie@juniper.net>2017-03-23 06:19:54 -0700
committerStuart Mackie <wsmackie@juniper.net>2017-03-23 06:19:54 -0700
commit88df88a19674ccc0017836941b8ee32eaadf19fb (patch)
treef930c90f75846ec8d8e33cf27325ff8fafc85d5c /charms/trusty/cassandra/hooks/hooks.py
parent9f50a40437477432a21b326b15c343ca6b8fe516 (diff)
Deleted charms with wrong license. Will source them differently in future.
Change-Id: I0fc99ea03c6b6ca4701e63793cb2be60e56c7588 Signed-off-by: Stuart Mackie <wsmackie@juniper.net>
Diffstat (limited to 'charms/trusty/cassandra/hooks/hooks.py')
-rw-r--r--charms/trusty/cassandra/hooks/hooks.py61
1 files changed, 0 insertions, 61 deletions
diff --git a/charms/trusty/cassandra/hooks/hooks.py b/charms/trusty/cassandra/hooks/hooks.py
deleted file mode 100644
index ef38c20..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 <http://www.gnu.org/licenses/>.
-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()))