Code review comment for lp:~jseutter/charms/precise/storage/storage-with-broker-provider

Revision history for this message
David Britton (dpb) wrote :

[5] Upon relation, the device is not set by block-storage-broker. I needed something like this to proceed:

https://pastebin.canonical.com/104472/

--- a/hooks/storage-provider.d/blockstoragebroker/block-storage-relation-changed
+++ b/hooks/storage-provider.d/blockstoragebroker/block-storage-relation-changed
@@ -18,4 +18,7 @@ if os.path.exists(config_changed):
     subprocess.check_call(config_changed)

 device_path = hookenv.relation_get("block-device-path")
-common_util.mount_volume(device_path) # Will wait until mountpoint is set by principal
+if device_path:
+ common_util.mount_volume(device_path) # Will wait until mountpoint is set by principal
+else:
+ hookenv.log("waiting for relation to define 'block-device-path")

« Back to merge proposal