File: swift-recon-only-query-object-servers-once.patch

package info (click to toggle)
swift 2.36.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 23,024 kB
  • sloc: python: 286,182; javascript: 1,059; sh: 619; pascal: 295; makefile: 81; xml: 32
file content (37 lines) | stat: -rw-r--r-- 1,727 bytes parent folder | download | duplicates (3)
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
Description: swift-recon: only query object servers once
Author: Thomas Goirand <zigo@debian.org>
Forwarded: no
Last-Update: 2023-04-28

Index: swift/swift/cli/recon.py
===================================================================
--- swift.orig/swift/cli/recon.py
+++ swift/swift/cli/recon.py
@@ -358,6 +358,13 @@ class SwiftRecon(object):
             if status == 200:
                 unmounted[url] = []
                 errors[url] = []
+                # Hack: Ignore all hosts where the port is the object one
+                # but the 6200. This is to ensure hosts are added only
+                # once in case we use the "one server per port" option
+                # of swift-object.
+                port=int(url.split(':')[2].split('/')[0])
+                if port > 6200 and port < 6400:
+                    continue
                 for i in response:
                     if not isinstance(i['mounted'], bool):
                         errors[url].append(i['device'])
@@ -902,6 +909,13 @@ class SwiftRecon(object):
                 recon.scout, filtered_hosts):
             if status == 200:
                 hostusage = []
+                # Hack: Ignore all hosts where the port is the object one
+                # but the 6200. This is to ensure hosts are added only
+                # once in case we use the "one server per port" option
+                # of swift-object.
+                port=int(url.split(':')[2].split('/')[0])
+                if port > 6200 and port < 6400:
+                    continue
                 for entry in response:
                     if not isinstance(entry['mounted'], bool):
                         print("-> %s/%s: Error: %s" % (url, entry['device'],