diff options
author | kali <kali@leap.se> | 2012-11-13 21:54:04 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2012-11-13 21:54:04 +0900 |
commit | d2dcf5a1060d60c451570349a6a06ad102d6924c (patch) | |
tree | 0797f2ff3bb8137f7ceff33eec91a033f60c2ab0 /src/leap/base | |
parent | d2d2bbd96a44c347c248a7abb2ee72d7d728d79f (diff) |
fix missing provider parameter in leapconfig objects chain
Diffstat (limited to 'src/leap/base')
-rw-r--r-- | src/leap/base/config.py | 1 | ||||
-rw-r--r-- | src/leap/base/providers.py | 14 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/leap/base/config.py b/src/leap/base/config.py index 9ce2e9f0..0255fbab 100644 --- a/src/leap/base/config.py +++ b/src/leap/base/config.py @@ -118,6 +118,7 @@ class JSONLeapConfig(BaseLeapConfig): " derived class") assert issubclass(self.spec, PluggableConfig) + self.domain = kwargs.pop('domain', None) self._config = self.spec(format="json") self._config.load() self.fetcher = kwargs.pop('fetcher', requests) diff --git a/src/leap/base/providers.py b/src/leap/base/providers.py index 7b219cc7..d41f3695 100644 --- a/src/leap/base/providers.py +++ b/src/leap/base/providers.py @@ -7,20 +7,20 @@ class LeapProviderDefinition(baseconfig.JSONLeapConfig): spec = specs.leap_provider_spec def _get_slug(self): - provider_path = baseconfig.get_default_provider_path() + domain = getattr(self, 'domain', None) + if domain: + path = baseconfig.get_provider_path(domain) + else: + path = baseconfig.get_default_provider_path() + return baseconfig.get_config_file( - 'provider.json', - folder=provider_path) + 'provider.json', folder=path) def _set_slug(self, *args, **kwargs): raise AttributeError("you cannot set slug") slug = property(_get_slug, _set_slug) - # TODO (MVS+) - # we will construct slug from providers/%s/definition.json - # where %s is domain name. we can get that on __init__ - class LeapProviderSet(object): # we gather them from the filesystem |