From 1206c054753e25d2c3d542cefdb2adca823c09a1 Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Sat, 30 Apr 2016 15:46:29 -0300 Subject: [feat] use netloc instead of an extra api_uri in Discovery --- bonafide/src/leap/bonafide/config.py | 2 +- bonafide/src/leap/bonafide/provider.py | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) (limited to 'bonafide/src/leap') diff --git a/bonafide/src/leap/bonafide/config.py b/bonafide/src/leap/bonafide/config.py index 8c34bc12..9da05579 100644 --- a/bonafide/src/leap/bonafide/config.py +++ b/bonafide/src/leap/bonafide/config.py @@ -452,7 +452,7 @@ class Provider(object): api_uri = self._provider_config.api_uri if api_uri: parsed = urlparse(api_uri) - self._disco.api_uri = parsed.netloc + self._disco.netloc = parsed.netloc def _get_config_for_all_services(self, session): services_dict = self._load_provider_configs() diff --git a/bonafide/src/leap/bonafide/provider.py b/bonafide/src/leap/bonafide/provider.py index 82824e9f..b44dae2e 100644 --- a/bonafide/src/leap/bonafide/provider.py +++ b/bonafide/src/leap/bonafide/provider.py @@ -160,19 +160,8 @@ class Discovery(BaseProvider): 'configs': ('1/configs.json', 'GET'), } - api_uri = None - api_port = None - def _get_base_url(self): - if self.api_uri: - base = self.api_uri - else: - base = self.netloc - - uri = "https://{0}".format(base) - if self.api_port: - uri = uri + ':%s' % self.api_port - return uri + return "https://{0}".format(self.netloc) def get_base_uri(self): return self._get_base_url() -- cgit v1.2.3