Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

1089678 - Format oldRoute to match newRoute, so that rhnServerPath is…

…n't updated every time
  • Loading branch information...
commit 4c5c2f21ebb5f7787c85e6785b8859bee16af734 1 parent 5775e76
tpapaioa authored April 21, 2014 sdherr committed April 24, 2014

Showing 1 changed file with 7 additions and 2 deletions. Show diff stats Hide diff stats

  1. 9  backend/server/rhnServer/server_route.py
9  backend/server/rhnServer/server_route.py
@@ -42,6 +42,11 @@ def store_client_route(server_id):
42 42
     oldRoute = h.fetchall_dict() or []
43 43
     newRoute = []
44 44
 
  45
+    # construct oldRoute_ from oldRoute, to have the actual format described above
  46
+    oldRouteTuples = []
  47
+    for oldRouteDict in oldRoute:
  48
+        oldRouteTuples.append((str(oldRouteDict['proxy_server_id']), oldRouteDict['hostname']))
  49
+
45 50
 
46 51
     # code block if there *is* routing info in the headers
47 52
     # NOTE: X-RHN-Proxy-Auth described in proxy/broker/rhnProxyAuth.py
@@ -62,12 +67,12 @@ def store_client_route(server_id):
62 67
 
63 68
         log_debug(4, "newRoute", newRoute)
64 69
 
65  
-    if oldRoute == newRoute:
  70
+    if oldRouteTuples == newRoute:
66 71
         # Nothing to do here
67 72
         # This also catches the case of no routes at all
68 73
         return
69 74
 
70  
-    if oldRoute:
  75
+    if oldRouteTuples:
71 76
         # blow away table rhnServerPath entries for server_id
72 77
         log_debug(8, 'blow away route-info for %s' % server_id)
73 78
         h = rhnSQL.prepare("""

0 notes on commit 4c5c2f2

Please sign in to comment.
Something went wrong with that request. Please try again.