Add uuid support to param2id() to allow commands including
cinder-manage volume delete to work with uuid style volumd ids
Fixes bug #
1158409
Change-Id: I2d197320b61f44d1104ed0342a6b5b70f673468a
(cherry picked from commit
e1561b8f8a05f3cd6b8635683b178f924384de65)
from cinder import flags
from cinder.openstack.common import log as logging
from cinder.openstack.common import rpc
+from cinder.openstack.common import uuidutils
from cinder import utils
from cinder import version
"""Helper function to convert various id types to internal id.
args: [object_id], e.g. 'vol-0000000a' or 'volume-0000000a' or '10'
"""
- if '-' in object_id:
+ if uuidutils.is_uuid_like(object_id):
+ return object_id
+ elif '-' in object_id:
# FIXME(ja): mapping occurs in nova?
pass
else: