Collections are now named flamenco_xxx instead of flamenco.xxx

The dot notation disallowed Eve hooks, as the collection names weren't
valid Python identifiers.
This commit is contained in:
Sybren A. Stüvel 2016-12-14 14:40:35 +01:00
parent a100d73a8b
commit 8115bc2ad5

View File

@ -225,12 +225,13 @@ class PillarServer(Eve):
eve_settings = pillar_extension.eve_settings()
if 'DOMAIN' in eve_settings:
pillar_ext_prefix = pillar_extension.name + '.'
pillar_ext_prefix = pillar_extension.name + '_'
pillar_url_prefix = pillar_extension.name + '/'
for key, collection in eve_settings['DOMAIN'].items():
assert key.startswith(pillar_ext_prefix), \
'Eve collection names of %s MUST start with %r' % \
(pillar_extension.name, pillar_ext_prefix)
url = key.replace('.', '/')
url = key.replace(pillar_ext_prefix, pillar_url_prefix)
collection.setdefault('datasource', {}).setdefault('source', key)
collection.setdefault('url', url)