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

package info (click to toggle)
swift 2.30.1-0%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 21,316 kB
  • sloc: python: 250,094; javascript: 1,059; sh: 645; pascal: 295; makefile: 86; xml: 32
file content (21 lines) | stat: -rw-r--r-- 946 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Description: swift-recon: only query object servers once
Author: Thomas Goirand <zigo@debian.org>
Forwarded: no
Last-Update: 2023-04-28

--- swift-2.31.1.orig/swift/cli/recon.py
+++ swift-2.31.1/swift/cli/recon.py
@@ -908,6 +908,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'],