示例#1
0
def volume_type_get(volume_type, region_name=None):
    if not uuidutils.is_uuid_like(volume_type):
        return volume_type

    c_client = get_cinderclient(region_name)
    try:
        vt = c_client.volume_types.get(volume_type)
    except NotFound:
        return None
    return vt.name
示例#2
0
def volume_type_get(volume_type, region_name=None):
    if not uuidutils.is_uuid_like(volume_type):
        return volume_type

    c_client = get_cinderclient(region_name)
    try:
        vt = c_client.volume_types.get(volume_type)
    except NotFound:
        return None
    return vt.name
示例#3
0
 def _lookup(self, order_id, *remainder):
     if remainder and not remainder[-1]:
         remainder = remainder[:-1]
     if uuidutils.is_uuid_like(order_id):
         return OrderController(order_id), remainder
示例#4
0
 def _lookup(self, order_id, *remainder):
     if remainder and not remainder[-1]:
         remainder = remainder[:-1]
     if uuidutils.is_uuid_like(order_id):
         return OrderController(order_id), remainder
示例#5
0
 def _lookup(self, product_id, *remainder):
     # drop last path if empty
     if remainder and not remainder[-1]:
         remainder = remainder[:-1]
     if uuidutils.is_uuid_like(product_id):
         return ProductController(product_id), remainder
示例#6
0
 def _lookup(self, product_id, *remainder):
     # drop last path if empty
     if remainder and not remainder[-1]:
         remainder = remainder[:-1]
     if uuidutils.is_uuid_like(product_id):
         return ProductController(product_id), remainder