Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/statsmaster/files/cron_geoipdb_update.py

Issue 29326111: Issue 3010 - Introduce class geoip (Closed)
Patch Set: Created Sept. 8, 2015, 12:11 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « modules/geoip/manifests/init.pp ('k') | modules/statsmaster/manifests/init.pp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/statsmaster/files/cron_geoipdb_update.py
diff --git a/modules/statsmaster/files/cron_geoipdb_update.py b/modules/statsmaster/files/cron_geoipdb_update.py
deleted file mode 100644
index d0a6243f3f17427827c1897c740e502259250e2f..0000000000000000000000000000000000000000
--- a/modules/statsmaster/files/cron_geoipdb_update.py
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env python
-
-import urllib
-import zlib
-
-downloads = {
- '/usr/share/GeoIP/GeoIP.dat': 'http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz',
- '/usr/share/GeoIP/GeoIPv6.dat': 'http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz',
-
- '/usr/share/GeoIP/GeoIPCity.dat': 'http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz',
- '/usr/share/GeoIP/GeoIPCityv6.dat': 'http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz',
-}
-
-for dest, source in downloads.iteritems():
- data = urllib.urlopen(source).read()
- with open(dest, "wb") as f:
- # wbit parameter value isn't properly documented, see https://stackoverflow.com/a/22310760/785541
- f.write(zlib.decompress(data, zlib.MAX_WBITS | 16))
« no previous file with comments | « modules/geoip/manifests/init.pp ('k') | modules/statsmaster/manifests/init.pp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld