Make config validation in common way
Each engine and provider can have property CONFIG_SCHEMA. Validation can be done in base constructor by calling validate method. Validate method can be overrided if needed.
class EngineFactory(
def __init__(self, task, config):
self.
self.task = task
self.config = config
def validate(config):
jsonschema.
if somethingwrong:
raise exceptions.
class SomeEngine(
CONFIG_SCHEMA = {'some': 'schema'}
def __init__(self, task, config):
super (SomeEngine, self).__init__()
do_own_init()
class SomeEngineWithC
def validate(config):
do_complex_
The same for Provider
Also rally.exception
Blueprint information
- Status:
- Complete
- Approver:
- Boris Pavlovic
- Priority:
- Medium
- Drafter:
- Sergey Skripnick
- Direction:
- Approved
- Assignee:
- Sergey Skripnick
- Definition:
- Approved
- Series goal:
- None
- Implementation:
- Implemented
- Milestone target:
- None
- Started by
- Sergey Skripnick
- Completed by
- Boris Pavlovic
Related branches
Related bugs
Sprints
Whiteboard
Gerrit topic: https:/
Addressed by: https:/
Add common config validation to EngineFactory
Addressed by: https:/
Add CONFIG_SCHEMA to devstack engine
Addressed by: https:/
Add CONFIG_SCHEMA to DummyEngine
Addressed by: https:/
Add common config validation to ProviderFactory
Addressed by: https:/
Add CONFIG_SCHEMA to openstack provider
Addressed by: https:/
Add CONFIG_SCHEMA to dummy provider
Addressed by: https:/
Add CONFIG_SCHEMA to virsh provider
Work Items
Work items:
[eyerediskin] common validation in deploy engines: DONE
[miarmak] common validation in providers: DONE