From: Stephen Mulcahy Date: Thu, 21 Mar 2013 17:57:24 +0000 (+0000) Subject: Extend param2id() to work with uuids X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=e1561b8f8a05f3cd6b8635683b178f924384de65;p=openstack-build%2Fcinder-build.git Extend param2id() to work with uuids 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 --- diff --git a/bin/cinder-manage b/bin/cinder-manage index 8436afc0f..15ad760b1 100755 --- a/bin/cinder-manage +++ b/bin/cinder-manage @@ -83,6 +83,7 @@ from cinder import exception 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 @@ -101,7 +102,9 @@ def param2id(object_id): """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: