glance.common.location_strategy package

Submodules

glance.common.location_strategy.location_order module

Image location order based location strategy module

glance.common.location_strategy.location_order.get_ordered_locations(locations, **kwargs)[source]

Order image location list.

Parameters:locations – The original image location list.
Returns:The image location list with original natural order.
glance.common.location_strategy.location_order.get_strategy_name()[source]

Return strategy module name.

glance.common.location_strategy.location_order.init()[source]

Initialize strategy module.

glance.common.location_strategy.store_type module

Storage preference based location strategy module

glance.common.location_strategy.store_type.get_ordered_locations(locations, uri_key='url', **kwargs)[source]

Order image location list.

Parameters:
  • locations – The original image location list.
  • uri_key – The key name for location URI in image location dictionary.
Returns:

The image location list with preferred store type order.

glance.common.location_strategy.store_type.get_strategy_name()[source]

Return strategy module name.

glance.common.location_strategy.store_type.init()[source]

Initialize strategy module.

Module contents

glance.common.location_strategy.choose_best_location(locations, **kwargs)[source]

Choose best location from image location list by configured strategy.

Parameters:
  • locations – The original image location list.
  • kwargs – Strategy-specific arguments for under layer strategy module.
Returns:

The best location from image location list.

glance.common.location_strategy.get_ordered_locations(locations, **kwargs)[source]

Order image location list by configured strategy.

Parameters:
  • locations – The original image location list.
  • kwargs – Strategy-specific arguments for under layer strategy module.
Returns:

The image location list with strategy-specific order.

glance.common.location_strategy.verify_location_strategy(conf=None, strategies={'location_order': <module 'glance.common.location_strategy.location_order' from '/home/jenkins/workspace/glance-docs-ubuntu-xenial/glance/common/location_strategy/location_order.py'>, 'store_type': <module 'glance.common.location_strategy.store_type' from '/home/jenkins/workspace/glance-docs-ubuntu-xenial/glance/common/location_strategy/store_type.py'>})[source]

Validate user configured ‘location_strategy’ option value.