keystone.common.resource_options.core module

Options specific to resources managed by Keystone (Domain, User, etc).

class keystone.common.resource_options.core.ResourceOption(option_id, option_name, validator=<function _validator>, json_schema_validation=None)[source]

Bases: object

property json_schema
property option_id
property option_name
class keystone.common.resource_options.core.ResourceOptionRegistry(registry_name)[source]

Bases: object

get_option_by_id(opt_id)[source]
get_option_by_name(name)[source]
property json_schema
property option_ids
property option_names
property options
property options_by_name
register_option(option)[source]
keystone.common.resource_options.core.boolean_validator(value)[source]
keystone.common.resource_options.core.get_resource_option(model, option_id)[source]

Get the resource option information from the model’s mapper.

keystone.common.resource_options.core.ref_mapper_to_dict_options(ref)[source]

Convert the values in _resource_option_mapper to options dict.

NOTE: this is to be called from the relevant to_dict methods or

similar and must be called from within the active session context.

Parameters:

ref – the DB model ref to extract options from

Returns:

Dict of options as expected to be returned out of to_dict in the options key.

keystone.common.resource_options.core.resource_options_ref_to_mapper(ref, option_class)[source]

Convert the _resource_options property-dict to options attr map.

The model must have the resource option mapper located in the _resource_option_mapper attribute.

The model must have the resource option registry located in the resource_options_registry attribute.

The option dict with key(opt_id), value(opt_value) will be pulled from ref._resource_options.

NOTE: This function MUST be called within the active writer session

context!

Parameters:
  • ref – The DB model reference that is actually stored to the backend.

  • option_class – Class that is used to store the resource option in the DB.