summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenuka Apte <renuka.apte@citrix.com>2011-05-11 17:06:56 -0700
committerRenuka Apte <renuka.apte@citrix.com>2011-05-11 17:06:56 -0700
commitfd8b9eb204b77da583f1aee4022920367730823f (patch)
tree7dea515aabc0d4a0c39df0f2aff4f50b841ecc64
parente171e7511c6b1a2baacf0ab9857643cc1fe82eb3 (diff)
downloadnova-fd8b9eb204b77da583f1aee4022920367730823f.tar.gz
nova-fd8b9eb204b77da583f1aee4022920367730823f.tar.xz
nova-fd8b9eb204b77da583f1aee4022920367730823f.zip
Fix remote volume code
-rw-r--r--nova/virt/xenapi/volume_utils.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/nova/virt/xenapi/volume_utils.py b/nova/virt/xenapi/volume_utils.py
index 55c11a4ad..7821a4f7e 100644
--- a/nova/virt/xenapi/volume_utils.py
+++ b/nova/virt/xenapi/volume_utils.py
@@ -204,13 +204,16 @@ def _get_volume_id(path_or_id):
if isinstance(path_or_id, int):
return path_or_id
# n must contain at least the volume_id
- # /vol- is for remote volumes
- # -vol- is for local volumes
+ # :volume- is for remote volumes
+ # -volume- is for local volumes
# see compute/manager->setup_compute_volume
- volume_id = path_or_id[path_or_id.find('/vol-') + 1:]
+ volume_id = path_or_id[path_or_id.find(':volume-') + 1:]
if volume_id == path_or_id:
volume_id = path_or_id[path_or_id.find('-volume--') + 1:]
volume_id = volume_id.replace('volume--', '')
+ else:
+ volume_id = volume_id.replace('volume-', '')
+ volume_id = volume_id[0:volume_id.find('-')]
return int(volume_id)