4Z2bikQnCVXQ1EKh1Puq9B changeset

Changeset333261336334 (b)
ParentNone (a)
ab
0+def view_rp(request, slug, envt, status, datacenter):
0+    envt_template = 'cyclo/rp_ville_'+status+'.txt'
0+
0+    stown = Town.objects.get(slug=slug);   
0+    if envt =="prod":
0+        for rp in stown.prod_rp.all():
0+            if rp.datacenter.slug == datacenter:
0+                rpwwwip = rp.http_www
0+                rpaboip = rp.https_abo
0+
0+        frontal_ip_list =[]
0+        for frontal in stown.prod_frontal.all():
0+            if frontal.datacenter.slug == datacenter:
0+                frontal_ip_list.append(frontal.ip)
0+                       
0+    elif envt == "preprod":
0+        for rp in stown.preprod_rp.all():
0+            if rp.datacenter.slug == datacenter:
0+                rpwwwip = rp.http_www
0+                rpaboip = rp.https_abo
0+
0+        frontal_ip_list =[]
0+        for frontal in stown.preprod_frontal.all():
0+            if frontal.datacenter.slug == datacenter:
0+                frontal_ip_list.append(frontal.ip)
0+       
0+    elif envt == "vabf":
0+        for rp in stown.vabf_rp.all():
0+            if rp.datacenter.slug == datacenter:
0+                rpwwwip = rp.http_www
0+                rpaboip = rp.https_abo
0+
0+        frontal_ip_list =[]
0+        for frontal in stown.vabf_frontal.all():
0+            if frontal.datacenter.slug == datacenter:
0+                frontal_ip_list.append(frontal.ip)
0+       
0+    return object_detail(
0+            request,
0+            queryset = Town.objects.all(),
0+            slug= slug,
0+            template_name = envt_template,
0+            mimetype='text/plain',
0+            extra_context = {
0+                "rpwwwip": rpwwwip,
0+                "rpaboip": rpaboip,
0+                "frontal_ip_list": frontal_ip_list,
0+            }
0+        )
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--- Revision None
+++ Revision 333261336334
@@ -0,0 +1,49 @@
+def view_rp(request, slug, envt, status, datacenter):
+ envt_template = 'cyclo/rp_ville_'+status+'.txt'
+
+ stown = Town.objects.get(slug=slug);
+ if envt =="prod":
+ for rp in stown.prod_rp.all():
+ if rp.datacenter.slug == datacenter:
+ rpwwwip = rp.http_www
+ rpaboip = rp.https_abo
+
+ frontal_ip_list =[]
+ for frontal in stown.prod_frontal.all():
+ if frontal.datacenter.slug == datacenter:
+ frontal_ip_list.append(frontal.ip)
+
+ elif envt == "preprod":
+ for rp in stown.preprod_rp.all():
+ if rp.datacenter.slug == datacenter:
+ rpwwwip = rp.http_www
+ rpaboip = rp.https_abo
+
+ frontal_ip_list =[]
+ for frontal in stown.preprod_frontal.all():
+ if frontal.datacenter.slug == datacenter:
+ frontal_ip_list.append(frontal.ip)
+
+ elif envt == "vabf":
+ for rp in stown.vabf_rp.all():
+ if rp.datacenter.slug == datacenter:
+ rpwwwip = rp.http_www
+ rpaboip = rp.https_abo
+
+ frontal_ip_list =[]
+ for frontal in stown.vabf_frontal.all():
+ if frontal.datacenter.slug == datacenter:
+ frontal_ip_list.append(frontal.ip)
+
+ return object_detail(
+ request,
+ queryset = Town.objects.all(),
+ slug= slug,
+ template_name = envt_template,
+ mimetype='text/plain',
+ extra_context = {
+ "rpwwwip": rpwwwip,
+ "rpaboip": rpaboip,
+ "frontal_ip_list": frontal_ip_list,
+ }
+ )