diff options
| author | Eric Day <eday@oddments.org> | 2011-01-04 12:27:50 -0800 |
|---|---|---|
| committer | Eric Day <eday@oddments.org> | 2011-01-04 12:27:50 -0800 |
| commit | 2899896d1c7742ad59e2da2d2369bc2ff9526fed (patch) | |
| tree | e3eb841e701649416c6189700aedb0b0681ea3c8 | |
| parent | 4b0509f014aa164273a0e544441838be5352b1eb (diff) | |
| download | nova-2899896d1c7742ad59e2da2d2369bc2ff9526fed.tar.gz nova-2899896d1c7742ad59e2da2d2369bc2ff9526fed.tar.xz nova-2899896d1c7742ad59e2da2d2369bc2ff9526fed.zip | |
Renamed argument to represent possible types in volume_utils.
| -rw-r--r-- | nova/virt/xenapi/volume_utils.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/nova/virt/xenapi/volume_utils.py b/nova/virt/xenapi/volume_utils.py index 0ad6fd450..4bbc41b03 100644 --- a/nova/virt/xenapi/volume_utils.py +++ b/nova/virt/xenapi/volume_utils.py @@ -200,18 +200,19 @@ class VolumeHelper(HelperBase): return -1 -def _get_volume_id(path): +def _get_volume_id(path_or_id): """Retrieve the volume id from device_path""" # If we have the ID and not a path, just return it. - if isinstance(path, int): - return path + 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 # see compute/manager->setup_compute_volume - volume_id = path[path.find('/vol-') + 1:] - if volume_id == path: - volume_id = path[path.find('-vol-') + 1:].replace('--', '-') + volume_id = path_or_id[path_or_id.find('/vol-') + 1:] + if volume_id == path_or_id: + volume_id = path_or_id[path_or_id.find('-vol-') + 1:] + volume_id = volume_id.replace('--', '-') return volume_id |
