Skip to content

Instantly share code, notes, and snippets.

@termie
termie / output from updated testr
Last active August 29, 2015 13:57
getting updated testr from source install for tox
getting useful testr exception output
tox -epy27 nova.tests.integrated
# ctrl-c after it has made it through the dependencies
source .tox/py27/bin/activate
pip install --allow-external bzr --allow-unverified bzr bzr
pip install -e bzr+lp:testrepository#egg=testrepository
@termie
termie / Recipe: Debug Logging in Nova
Last active August 29, 2015 13:57
Recipe: Debug Logging in Nova
Serves 1:
- spend one hour attempting every common way of enabling debug or verbose logging in the cli or config
- run_tests.sh? deprecated? use tox? install tox? --debug?
- downgrade one dependency
- try `pip install tox==1.6.1`
- spend another hour attempting every common way of manually hardcoding the log level to be debug
- acquire blob of text: https://gist.githubusercontent.com/termie/9358089/raw/80df96f5d1f0886f672253612972849ef5196886/gistfile1.txt
- hack your venv to install another dependency from trunk source
- like so: https://gist.github.com/termie/9358833
@termie
termie / nova_test.yaml
Created March 11, 2014 22:50
autogenerated nova api call definitions
addFixedIp_servers:
path: /%(project_id)s/servers/%(id)s/action
post:
- - project_id
- string
- - id
- string
- - networkId
- string
request:
@termie
termie / nova_api.json
Created March 12, 2014 02:31
nova api
[('Could not match route',
{u'body': u'',
u'content_type': u'text',
u'method': u'GET',
u'path': u'/v2/openstack//foxnsocks',
u'version': u'v2'})]
{u'addFixedIp_servers': [{'action': u'action',
'body': {u'addFixedIp': {u'networkId': 1}},
'class_name': 'servers',
'content_type': 'json',
@termie
termie / calls
Last active August 29, 2015 13:57
nova api calls
This file has been truncated, but you can view the full file.
{u'calls': {u'addFixedIp_servers': [{u'action': u'action',
u'body': {u'addFixedIp': {u'networkId': 1}},
u'class_name': u'Controller',
u'content_type': u'json',
u'method': u'POST',
u'module_name': u'servers',
u'name': u'addFixedIp_servers',
u'path': u'/openstack/servers/e72c5cd4-2bb6-43e3-a763-53be50811fed/action',
u'qs': u'',
u'raw_module': u'nova.api.openstack.compute.servers',
@termie
termie / gist:9772999
Created March 25, 2014 22:36
params used in nova create_server calls from integrated tests
All
[u'OS-DCF:diskConfig',
u'availability_zone',
u'block_device_mapping_v2',
u'flavorRef',
u'imageRef',
u'max_count',
u'metadata',
u'min_count',
u'name',
@termie
termie / gist:700ab185b4393ec43b22
Last active September 20, 2017 18:13
golang: yaml and strings and interfaces oh my
Dear internet, I have a stupid data structure transformation problem
(and probably an "i don't understand go interfaces" problem)
data = {'build': {'steps': [{'some_name': {'data1': 'foo', 'data2': 'bar'}},
{'another_name': {'data3': 'baz', 'data4': 'qux'}}
]
}
}
- name: fleet.socket
command: start
content: |
[Socket]
ListenStream=6000
Service=fleet.service
[Install]
WantedBy=sockets.target
# Ensure that etcd is starting fresh
config.vm.provision :shell, :inline => "systemctl stop etcd"
config.vm.provision :shell, :inline => "rm -rf /var/lib/etcd/*", :privileged => true
$script = <<SCRIPT
for x in $(cat /etc/environment); do
export $x
done
coreos-cloudinit --from-file /var/lib/coreos-vagrant/vagrantfile-user-data
SCRIPT
@termie
termie / background.js
Last active August 29, 2015 14:10
quick dream chrome extension: shorten tab names in busy windows
// Also probably need a background page with tab permissions: https://developer.chrome.com/extensions/tabs
// listening for onCreated, onUpdated and do a
chrome.tabs.onCreated.addListener(tabCreated);
function tabCreated(tab) {
chrome.tabs.query({"windowId": tab.windowId}, function (tabList) {
tablist.forEach(function (aTab) {
aTab.sendMessage({"numTabs": tabList.size()});
})
})