Skip to content

Instantly share code, notes, and snippets.

matthewoliver /
Created Jun 4, 2020 - playing with SR ranges overlap and gap detection
from swift.common.utils import Timestamp, ShardRange
from collections import defaultdict
from pprint import pprint
range_list_sharded = (('', 'b'), ('b', 'c'), ('c','d'), ('b', 'd'), ('d', 'l'), ('l', 'q'), ('q', ''))
range_list_good = (('', 'c'), ('c', 'f'), ('f', 't'), ('t', ''))
range_list_extra = (('', 'd'), ('d', 'g'), ('g', 's'), ('s', ''))
matthewoliver / Infra_links.txt
Created May 3, 2019
Docker image zuul build conversation
View Infra_links.txt
matthewoliver / multi_keystone_reseller.patch
Created Mar 27, 2018
A patch the allows you to have multiple keystoneauth middlewares into a single proxy pipeline
View multi_keystone_reseller.patch
diff --git a/swift/common/middleware/ b/swift/common/middleware/
index cb1b4c7c3..57405079d 100644
--- a/swift/common/middleware/
+++ b/swift/common/middleware/
@@ -17,7 +17,8 @@ from swift.common.http import is_success
from swift.common.middleware import acl as swift_acl
from swift.common.request_helpers import get_sys_meta_prefix
from swift.common.swob import HTTPNotFound, HTTPForbidden, HTTPUnauthorized
-from swift.common.utils import config_read_reseller_options, list_from_csv
+from swift.common.utils import config_read_reseller_options, list_from_csv, \
import sys
from swift.common.ring.builder import RingBuilder
from swift.common.ring import Ring
import optparse
class PartDiff(object):
def _load_file(self, filename):
if filename.endswith('.gz'):
builder = Ring(filename) = builder.partition_count
matthewoliver /
Created Jun 25, 2017
benchmark reloading times in Swift - start a bunch of proxies on the same port (SO_REUSEPORT) then roll through very quickly terminate and recreate proxies processes.
import multiprocessing
import time
from swift.common.wsgi import run_wsgi
def start_daemon(conf_file='/etc/swift/proxy-server.conf', options={}):
run_wsgi(conf_file, 'proxy-server', **options)
View gist:f9e050dd21ac36d717fe
self.qemu_cmd = '%s -netdev type=%s,id=net0 -device %s,netdev=net0' % \
(self.qemu_cmd, 'user', netdev)
View gist:71fdabac115f76c4f4a7
Module Variables ("vars"):
"_original_file": "/etc/ansible/roles/test/tasks/main.yml",
"always_run": false,
"changed_when": null,
"delegate_to": null,
"failed_when": null,
"ignore_errors": false,
"inventory_dir": "/etc/ansible",
You can’t perform that action at this time.