Skip to content

Instantly share code, notes, and snippets.

@dtroyer
dtroyer / projects.md
Last active November 8, 2022 23:23
Project Examples

OpenStack

golang-client

[https://opendev.org/x/golang-client](OpenStack golang-client)

The only Go I did for OpenStack, this was intended to be an SDK for OpenStack APIs that mirrored the structure of the Python SDK. It was essentially abandoned in 2015 for reasons I'll not bother with here.

@dtroyer
dtroyer / local.conf-base
Created June 25, 2019 17:42
StarlingX & DevStack
# local.conf base
[[local|localrc]]
USE_PYTHON3=True
# Services
enable_service placement-api
disable_service h-eng h-api h-api-cfn h-api-cw
disable_service horizon
@dtroyer
dtroyer / gist:5d420b65d898019467dd2c9a03c15407
Last active June 15, 2019 19:23
Steps to extract playbookconfig from starlingx/config
* Put current oslo.tools somewhere:
export OSLO_TOOLS=$HOME/src/openstack/oslo.tools
* Make a workspace:
mkdir tmp; cd tmp
# Get the source repo
git clone https://opendev.org/starlingx/config.git
# Get the original ansible-playbooks repo from Gerrit for comparison
@dtroyer
dtroyer / gist:a065b77ebe0443659898
Last active September 19, 2019 15:20
Test traps, errexit, errtrace
#!/bin/bash
# Do some errexit testing
# 0 - test success
# 1 - test simple fail
# 2 - test function fail
#
# in function
# N errexit errtrace pass?
### Keybase proof
I hereby claim:
* I am dtroyer on github.
* I am dtroyer (https://keybase.io/dtroyer) on keybase.
* I have a public key whose fingerprint is F569 48BF 59C9 B450 1378 6D6A B644 3F75 C6CF 6822
To claim this, I am signing this object:
@dtroyer
dtroyer / logtest.sh
Created March 5, 2014 17:02
DevStack-style log redirection wrapper
#!/bin/bash
# Test stack.sh logging scenarios
LOGFILE=${LOGFILE:-test.log}
SUMFILE=sum.log
VERBOSE=${VERBOSE:-True}
# Kill background processes on exit
trap exit_trap EXIT
function exit_trap {
dtroyer@dstack:/opt/stack/python-troveclient (master) $ cd /opt/stack/trove/; bin/trove-api --config-file=/etc/trove//trove.conf --debug 2>&1 | tee /var/log/trove/trove-api.log || echo "tr-api failed to start" | tee "/opt/stack/status/stack/tr-api.failure"
tee: /var/log/trove/trove-api.log: No such file or directory
2013-09-05 15:14:04.835 17330 INFO trove.db.sqlalchemy.session [-] Creating SQLAlchemy engine with args: {'pool_recycle': 3600, 'echo': False}
2013-09-05 15:14:05.011 17330 CRITICAL root [-] No section 'trove' (prefixed by 'app' or 'application' or 'composite' or 'composit' or 'pipeline' or 'filter-app') found in config /etc/trove/api-paste.ini
tr-api failed to start
#!/usr/bin/env bash
# **install_pip.sh**
# install_pip.sh [--force]
#
# Update pip and friends to a known common version
# Removes any vendor-packaged pip/setuptools/distribute and re-installs
# from source