From 88df88a19674ccc0017836941b8ee32eaadf19fb Mon Sep 17 00:00:00 2001 From: Stuart Mackie Date: Thu, 23 Mar 2017 06:19:54 -0700 Subject: Deleted charms with wrong license. Will source them differently in future. Change-Id: I0fc99ea03c6b6ca4701e63793cb2be60e56c7588 Signed-off-by: Stuart Mackie --- charms/trusty/kafka/actions/create-topic | 40 -------------------------------- 1 file changed, 40 deletions(-) delete mode 100755 charms/trusty/kafka/actions/create-topic (limited to 'charms/trusty/kafka/actions/create-topic') diff --git a/charms/trusty/kafka/actions/create-topic b/charms/trusty/kafka/actions/create-topic deleted file mode 100755 index 4910430..0000000 --- a/charms/trusty/kafka/actions/create-topic +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python -import sys - -try: - from charmhelpers.core import hookenv - from charmhelpers.core import unitdata - from jujubigdata import utils - from jujubigdata.relations import Zookeeper - charm_ready = unitdata.kv().get('charm.active', False) -except ImportError: - charm_ready = False - -if not charm_ready: - # might not have hookenv.action_fail available yet - from subprocess import call - call(['action-fail', 'Kafka service not yet ready']) - -# Grab the business -topic_name = hookenv.action_get('topic') -topic_partitions = hookenv.action_get('partitions') -topic_replication = hookenv.action_get('replication') - -# Create the topic if we've got zookeepers; otherwise fail. -if Zookeeper().connected_units() and Zookeeper().is_ready(): - zks = [] - for unit, data in Zookeeper().filtered_data().items(): - ip = utils.resolve_private_address(data['private-address']) - zks.append("%s:%s" % (ip, data['port'])) - zks.sort() - zookeepers = ",".join(zks) - output = utils.run_as('kafka', 'kafka-topics.sh', - '--zookeeper', zookeepers, '--create', - '--topic', topic_name, - '--partitions', topic_partitions, - '--replication-factor', topic_replication, - capture_output=True) - hookenv.action_set({'output': output}) -else: - hookenv.action_fail('Zookeeper relation is not present/ready') - sys.exit() -- cgit 1.2.3-korg