Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Riedemann mriedem

View GitHub Profile
View notebook-5799-json-logging.diff
diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py
index 45c1cb5eb..a443125fd 100755
--- a/notebook/notebookapp.py
+++ b/notebook/notebookapp.py
@@ -139,19 +139,6 @@ try:
except ImportError:
terminado_available = False
-# Tolerate missing json_logging package.
-_enable_json_logs = enable_json_logs()
@mriedem
mriedem / hub-stress-test.py
Created Jul 27, 2020
Python script for loading up and purging users and notebook server pods in a JupyterHub deployment.
View hub-stress-test.py
#!/usr/bin/env python3
import argparse
from concurrent import futures
from datetime import datetime
import functools
import logging
import mock
import os
import sys
View gist:e01252253600abbef95045d73cfe2206
b'2019-12-03 22:35:14,048 ERROR [root] Original exception being dropped: [\'Traceback (most recent call last):\\n\', \' File "/home/zuul/src/opendev.org/openstack/nova/.tox/functional-py36/lib/python3.6/site-packages/oslo_messaging/_drivers/impl_fake.py", line 208, in _send\\n reply, failure = reply_q.get(timeout=timeout)\\n\', \' File "/home/zuul/src/opendev.org/openstack/nova/.tox/functional-py36/lib/python3.6/site-packages/eventlet/queue.py", line 322, in get\\n return waiter.wait()\\n\', \' File "/home/zuul/src/opendev.org/openstack/nova/.tox/functional-py36/lib/python3.6/site-packages/eventlet/queue.py", line 141, in wait\\n return get_hub().switch()\\n\', \' File "/home/zuul/src/opendev.org/openstack/nova/.tox/functional-py36/lib/python3.6/site-packages/eventlet/hubs/hub.py", line 298, in switch\\n return self.greenlet.switch()\\n\', \'queue.Empty\\n\', \'\\nDuring handling of the above exception, another exception occurred:\\n\\n\', \'Traceback (most recent call last):\\n\', \' File "/
View gist:616c311e9665f40ffbf4dcb016b4bc33
[[local|localrc]]
# Minimal Contents
# ----------------
MRIEDEM_PASSWORD=openstack1
SERVICE_TOKEN=$MRIEDEM_PASSWORD
ADMIN_PASSWORD=$MRIEDEM_PASSWORD
MYSQL_PASSWORD=$MRIEDEM_PASSWORD
RABBIT_PASSWORD=$MRIEDEM_PASSWORD
View gist:9fce3c68336f8abb5d4753c156d8f96f
b'2018-10-26 10:19:26,115 ERROR [oslo_messaging.rpc.server] Exception during message handling'
b'Traceback (most recent call last):'
b' File "/home/osboxes/git/nova/.tox/py35/lib/python3.5/site-packages/oslo_messaging/rpc/server.py", line 166, in _process_incoming'
b' res = self.dispatcher.dispatch(message)'
b' File "/home/osboxes/git/nova/.tox/py35/lib/python3.5/site-packages/oslo_messaging/rpc/dispatcher.py", line 265, in dispatch'
b' return self._do_dispatch(endpoint, method, ctxt, args)'
b' File "/home/osboxes/git/nova/.tox/py35/lib/python3.5/site-packages/oslo_messaging/rpc/dispatcher.py", line 194, in _do_dispatch'
b' result = func(ctxt, **new_args)'
b' File "/home/osboxes/git/nova/.tox/py35/lib/python3.5/site-packages/oslo_messaging/rpc/server.py", line 229, in inner'
b' return func(*args, **kwargs)'
View gist:3f1560a7e9697ade633ab11b6aab8c62
diff --git a/nova/objects/instance.py b/nova/objects/instance.py
index 27fd416..0df32ab 100644
--- a/nova/objects/instance.py
+++ b/nova/objects/instance.py
@@ -324,17 +324,32 @@ class Instance(base.NovaPersistentObject, base.NovaObject,
def _flavor_from_db(self, db_flavor):
"""Load instance flavor information from instance_extra."""
+ # Before we stored flavors in instance_extra, certain fields, defined
+ # in nova.compute.flavors.system_metadata_flavor_props, were stored
View gist:66be7b3c3283c5fd00934c8294e5f67a
[
{
u'server_id':u'43bc2379-86d5-49b2-a87c-5351e19ca69c',
u'attachment_id':u'95dbfdd8-a615-4c66-a32a-79dc0dfd344e',
u'attached_at':u'2018-01-02T21:37:57.000000',
u'host_name':u'queens',
u'volume_id':u'373c2a29-f6e7-4931-adda-6b87a193e9f9',
u'device':u'/dev/vdb',
u'id':u'373c2a29-f6e7-4931-adda-6b87a193e9f9'
}
View gist:3da0a2edf18be0487e8becad31293077
The fix for `OSSA-2017-005`_ (CVE-2017-16239) was too far-reaching in that
rebuilds can now fail based on scheduling filters that should not apply
to rebuild. For example, a rebuild of an instance on a disabled compute
host could fail whereas it would not before the fix for CVE-2017-16239.
Similarly, rebuilding an instance on a host that is at capacity for vcpu,
memory or disk could fail since the scheduler filters would treat it as a
new build request even though the rebuild is not claiming *new* resources.
Therefore this release contains a fix for those regressions in scheduling
behavior on rebuild while maintaining the original fix for CVE-2017-16239.
View gist:706bcfbac773660310c38ad319ce7fe2
2017-08-22 13:33:00,808 INFO [nova.compute.resource_tracker] Compute node record created for host2:fake-mini with uuid: 13991939-e0db-41f9-af4d-c27822c5bfa4
2017-08-22 13:33:00,817 INFO [nova.api.openstack.placement.requestlog] 127.0.0.1 "GET /placement/resource_providers/13991939-e0db-41f9-af4d-c27822c5bfa4" status: 404 len: 227 microversion: 1.0
2017-08-22 13:33:00,822 INFO [nova.api.openstack.placement.requestlog] 127.0.0.1 "POST /placement/resource_providers" status: 409 len: 233 microversion: 1.0
2017-08-22 13:33:00,822 INFO [nova.scheduler.client.report] [req-b2116f36-098a-4a4b-b7cd-f2f1c8b7f372] Another thread already created a resource provider with the UUID 13991939-e0db-41f9-af4d-c27822c5bfa4. Grabbing that record from the placement API.
2017-08-22 13:33:00,825 INFO [nova.api.openstack.placement.requestlog] 127.0.0.1 "GET /placement/resource_providers/13991939-e0db-41f9-af4d-c27822c5bfa4" status: 404 len: 227 microversion: 1.0
View gist:4a6dcb52ed867af14f16989d7b83739a
Exception occurred:
File "/home/user/git/nova/nova/conf/opts.py", line 78, in _append_config_options
for key, val in configs.items():
AttributeError: 'list' object has no attribute 'items'
You can’t perform that action at this time.