Github user kwmonroe commented on a diff in the pull request:
https://github.com/apache/bigtop/pull/400#discussion_r222415197
--- Diff: bigtop-packages/src/charm/kafka/layer-kafka/reactive/kafka.py ---
@@ -90,3 +98,39 @@ def serve_client(client, zookeeper):
client.send_port(kafka_port)
client.send_zookeepers(zookeeper.zookeepers())
hookenv.log('Sent Kafka configuration to client')
+
+
+@hook('logs-storage-attached')
+def storage_attach():
+ storageids = hookenv.storage_list('logs')
+ if not storageids:
+ hookenv.status_set('blocked', 'cannot locate attached storage')
+ return
+ storageid = storageids[0]
--- End diff --
I'm embarrassingly unfamiliar with `storage: multiple: range:` like you
have defined in `metadata.yaml`. Is `storageids[0]` safe here because the range
maxes out at 1 and therefore we'll only have 1 element in this list?
---