Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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