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")
[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/blockstorageb roker/block- storage- relation- changed storage- provider. d/blockstorageb roker/block- storage- relation- changed exists( config_ changed) : .check_ call(config_ changed)
+++ b/hooks/
@@ -18,4 +18,7 @@ if os.path.
subprocess
device_path = hookenv. relation_ get("block- device- path") util.mount_ volume( device_ path) # Will wait until mountpoint is set by principal util.mount_ volume( device_ path) # Will wait until mountpoint is set by principal log("waiting for relation to define 'block- device- path")
-common_
+if device_path:
+ common_
+else:
+ hookenv.