Skip to content

Instantly share code, notes, and snippets.

@matthewoliver
matthewoliver / sr_overlaps.py
Created Jun 4, 2020
sr_overlaps.py - playing with SR ranges overlap and gap detection
View sr_overlaps.py
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
matthewoliver / Infra_links.txt
Created May 3, 2019
Docker image zuul build conversation
View Infra_links.txt
@matthewoliver
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/keystoneauth.py b/swift/common/middleware/keystoneauth.py
index cb1b4c7c3..57405079d 100644
--- a/swift/common/middleware/keystoneauth.py
+++ b/swift/common/middleware/keystoneauth.py
@@ -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, \
View part_diff.py
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.parts = builder.partition_count
@matthewoliver
matthewoliver / reloader.py
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.
View reloader.py
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.