Ejemplo n.º 1
0
def get_view_builder(req):
    '''
    A factory method that returns the correct builder based on the version of
    the api requested.
    '''
    version = common.get_api_version(req)
    if version == '1.1':
        return ViewBuilder_1_1()
    else:
        return ViewBuilder_1_0()
Ejemplo n.º 2
0
def get_view_builder(req):
    '''
    A factory method that returns the correct builder based on the version of
    the api requested.
    '''
    version = common.get_api_version(req)
    if version == '1.1':
        return ViewBuilder_1_1()
    else:
        return ViewBuilder_1_0()
Ejemplo n.º 3
0
def get_view_builder(req):
    '''
    A factory method that returns the correct builder based on the version of
    the api requested.
    '''
    version = common.get_api_version(req)
    addresses_builder = addresses_view.get_view_builder(req)
    if version == '1.1':
        flavor_builder = flavors_view.get_view_builder(req)
        image_builder = images_view.get_view_builder(req)
        return ViewBuilder_1_1(addresses_builder, flavor_builder,
                               image_builder)
    else:
        return ViewBuilder_1_0(addresses_builder)
Ejemplo n.º 4
0
def get_view_builder(req):
    '''
    A factory method that returns the correct builder based on the version of
    the api requested.
    '''
    version = common.get_api_version(req)
    addresses_builder = addresses_view.get_view_builder(req)
    if version == '1.1':
        flavor_builder = flavors_view.get_view_builder(req)
        image_builder = images_view.get_view_builder(req)
        return ViewBuilder_1_1(addresses_builder, flavor_builder,
                               image_builder)
    else:
        return ViewBuilder_1_0(addresses_builder)