The zaqar.common.utils module

utils: general-purpose utilities.

dict_to_conf(options)

Converts a python dictionary to a list of oslo_config.cfg.Opt

Parameters:options (dict) – The python dictionary to convert
Returns:a list of options compatible with oslo_config
Return type:[oslo_config.cfg.Opt]
fields(d, names, pred=<function <lambda>>, key_transform=<function <lambda>>, value_transform=<function <lambda>>)

Returns the entries in this dictionary with keys appearing in names.

Parameters:
  • pred ((a -> bool)) – a filter that is applied to the values of the dictionary.
  • key_transform (a -> a) – a transform to apply to the key before returning it
  • value_transform (a -> a) – a transform to apply to the value before returning it
Return type:

dict