summaryrefslogtreecommitdiffstats
path: root/bin/tracker_data.py
diff options
context:
space:
mode:
authorChris Lamb <lamby@debian.org>2016-01-11 12:59:31 +0000
committerChris Lamb <lamby@debian.org>2016-01-11 12:59:31 +0000
commit31130e733dd4cfc950b9c647f7aa6a8b8b8ea8df (patch)
tree6be4a18ddf1c679d9fb8e0acf83d647fe175eae3 /bin/tracker_data.py
parent60049661607621d4cd8f82d51e71d8b01d70ce15 (diff)
No need for explicit conditional; raise_for_status does this by design
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@38839 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'bin/tracker_data.py')
-rw-r--r--bin/tracker_data.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/bin/tracker_data.py b/bin/tracker_data.py
index f05dd256a3..28f8a7f17a 100644
--- a/bin/tracker_data.py
+++ b/bin/tracker_data.py
@@ -93,13 +93,11 @@ class TrackerData(object):
print("Updating {} from {} ...".format(self.CACHED_DATA_PATH,
self.DATA_URL))
response = requests.get(self.DATA_URL, allow_redirects=True)
- if response.status_code == 200:
- with open(self.cached_data_path, 'w') as cache_file:
- cache_file.write(response.text)
- with open(self.cached_revision_path, 'w') as rev_file:
- rev_file.write('{}'.format(self.latest_revision))
- else:
- response.raise_for_status()
+ response.raise_for_status()
+ with open(self.cached_data_path, 'w') as cache_file:
+ cache_file.write(response.text)
+ with open(self.cached_revision_path, 'w') as rev_file:
+ rev_file.write('{}'.format(self.latest_revision))
def load(self):
with open(self.cached_data_path, 'r') as f:

© 2014-2024 Faster IT GmbH | imprint | privacy policy