new class BackendConfig to manage backend configs
This commit is contained in:
parent
be2be4af9c
commit
cb1372b99f
23 changed files with 234 additions and 171 deletions
|
|
@ -73,6 +73,14 @@ class BackendsConfig(object):
|
|||
continue
|
||||
yield instance_name, backend_name, params
|
||||
|
||||
def backend_exists(self, name):
|
||||
"""
|
||||
Return True if the backend exists in config.
|
||||
"""
|
||||
config = RawConfigParser()
|
||||
config.read(self.confpath)
|
||||
return name in config.sections()
|
||||
|
||||
def add_backend(self, instance_name, backend_name, params, edit=False):
|
||||
if not instance_name:
|
||||
raise ValueError(u'Please give a name to the configured backend.')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue