diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-03-13 10:05:58 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-03-13 10:05:58 -0300 |
commit | 0ff122cf9fd0a76871093b595910fb7c0d3bfe85 (patch) | |
tree | 569de142c213385ddc7eac9285a106fdd4957ffe /src/leap/services | |
parent | 70c402fe170ca4e01159b03739b7cacda7b0dfd0 (diff) |
Pass mtime to pluggableconfig's load
Also add a request_helpers file to util where all the helper methods for
handling requests should go
Diffstat (limited to 'src/leap/services')
-rw-r--r-- | src/leap/services/eip/eipbootstrapper.py | 5 | ||||
-rw-r--r-- | src/leap/services/eip/providerbootstrapper.py | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/leap/services/eip/eipbootstrapper.py b/src/leap/services/eip/eipbootstrapper.py index fdf54bbb..84a309cb 100644 --- a/src/leap/services/eip/eipbootstrapper.py +++ b/src/leap/services/eip/eipbootstrapper.py @@ -32,6 +32,7 @@ from leap.services.eip.eipconfig import EIPConfig from leap.util.check import leap_assert, leap_assert_type from leap.util.checkerthread import CheckerThread from leap.util.files import check_and_fix_urw_only, get_mtime +from leap.util.request_helpers import get_content logger = logging.getLogger(__name__) @@ -114,9 +115,9 @@ class EIPBootstrapper(QtCore.QObject): if res.status_code == 304: logger.debug("EIP definition has not been modified") else: - eip_definition = res.content + eip_definition, mtime = get_content(res) - self._eip_config.load(data=eip_definition) + self._eip_config.load(data=eip_definition, mtime=mtime) self._eip_config.save(["leap", "providers", self._provider_config.get_domain(), diff --git a/src/leap/services/eip/providerbootstrapper.py b/src/leap/services/eip/providerbootstrapper.py index f1a917f0..4fdd9b8d 100644 --- a/src/leap/services/eip/providerbootstrapper.py +++ b/src/leap/services/eip/providerbootstrapper.py @@ -32,6 +32,7 @@ from leap.config.providerconfig import ProviderConfig from leap.util.check import leap_assert, leap_assert_type from leap.util.checkerthread import CheckerThread from leap.util.files import check_and_fix_urw_only, get_mtime +from leap.util.request_helpers import get_content logger = logging.getLogger(__name__) @@ -172,10 +173,10 @@ class ProviderBootstrapper(QtCore.QObject): if res.status_code == 304: logger.debug("Provider definition has not been modified") else: - provider_definition = res.content + provider_definition, mtime = get_content(res) provider_config = ProviderConfig() - provider_config.load(data=provider_definition) + provider_config.load(data=provider_definition, mtime=mtime) provider_config.save(["leap", "providers", self._domain, |