1 |
commit: 0f28dae401157afc08aede61016ad363ac344bd8 |
2 |
Author: Max Magorsch <arzano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Apr 27 19:23:11 2020 +0000 |
4 |
Commit: Max Magorsch <arzano <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Apr 27 19:23:11 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=0f28dae4 |
7 |
|
8 |
Add the host of the mirror to the json files |
9 |
|
10 |
Signed-off-by: Max Magorsch <arzano <AT> gentoo.org> |
11 |
|
12 |
json/generate-json.py | 12 +++++++----- |
13 |
1 file changed, 7 insertions(+), 5 deletions(-) |
14 |
|
15 |
diff --git a/json/generate-json.py b/json/generate-json.py |
16 |
index ced3cc8..c452e81 100755 |
17 |
--- a/json/generate-json.py |
18 |
+++ b/json/generate-json.py |
19 |
@@ -24,11 +24,13 @@ try: |
20 |
|
21 |
line = raw_line.split(" ") |
22 |
protocol = line[0].split("://")[0] |
23 |
- url = line[0].split("://")[1] |
24 |
+ host = line[0].split("://")[1] |
25 |
+ host = host.split("/")[0] |
26 |
|
27 |
state = { |
28 |
"Protocol" : protocol, |
29 |
- "Url" : url, |
30 |
+ "Host" : host, |
31 |
+ "Url" : line[0], |
32 |
"Age" : line[1], |
33 |
"StatusLastProbe" : line[2], |
34 |
"TimeLastSuccessfulProbe" : line[3], |
35 |
@@ -37,10 +39,10 @@ try: |
36 |
"LastProbe" : line[6].strip(), |
37 |
} |
38 |
|
39 |
- if url not in mirrors: |
40 |
- mirrors[url] = [] |
41 |
+ if host not in mirrors: |
42 |
+ mirrors[host] = [] |
43 |
|
44 |
- mirrors[url].append(state) |
45 |
+ mirrors[host].append(state) |
46 |
|
47 |
data = {} |
48 |
data["LastUpdate"] = int(time.time()) |