Browse code

Merge "XenAPI: Get pool default SR rather than "Local storage""

Jenkins authored on 2013/10/22 21:40:19
Showing 1 changed files
... ...
@@ -69,11 +69,17 @@ function install_xapi_plugins_from {
69 69
 }
70 70
 
71 71
 function get_local_sr {
72
-    xe sr-list name-label="Local storage" --minimal
72
+    xe pool-list params=default-SR minimal=true
73 73
 }
74 74
 
75 75
 function get_local_sr_path {
76
-    echo "/var/run/sr-mount/$(get_local_sr)"
76
+    pbd_path="/var/run/sr-mount/$(get_local_sr)"
77
+    pbd_device_config_path=`xe pbd-list sr-uuid=$(get_local_sr) params=device-config | grep " path: "`
78
+    if [ -n "$pbd_device_config_path" ]; then
79
+        pbd_uuid=`xe pbd-list sr-uuid=$(get_local_sr) minimal=true`
80
+        pbd_path=`xe pbd-param-get uuid=$pbd_uuid param-name=device-config param-key=path || echo ""`
81
+    fi
82
+    echo $pbd_path
77 83
 }
78 84
 
79 85
 function find_ip_by_name() {