This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# assuming that I run the unit test of oslo.service | |
# https://github.com/openstack/oslo.service | |
# if you want to do the same things you need first to clone the oslo.service project | |
# to initialize tox environment you need to first tox basicaly | |
tox -e py35 | |
# now your environment is setup you can run individual test by using testtools like this | |
.tox/py35/bin/python -m testtools.run oslo_service.tests.test_service.ServiceLauncherTest.test_child_signal_sighup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cProfile | |
pr = cProfile.Profile() | |
pr.enable() | |
# execute python code to profile | |
print("test") | |
pr.disable() | |
pr.dump_stats("/tmp/debug.cprof") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl https://herve.beraud.io/ 2>/dev/null | sed -n '/d/s/.*name="description"\s\+content="\([^"]\+\).*/\1/p' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# remove old fix container | |
podman rm -f fix | |
# patch container with debug changes | |
podman run --name=fix -u root --net=host -it 192.168.122.1:5000/fedora-binary-nova-api:ospsprint bash -c "curl http://file.cdg.redhat.com/hberaud/context.py -o /tmp/context.py && mv /tmp/context.py /usr/lib/python3.6/site-packages/nova && cat /usr/lib/python3.6/site-packages/nova/context.py" | |
# commit changes to apply debug changes | |
podman commit --change CMD='kolla_start' fix 192.168.122.1:5000/fedora-binary-nova-api:ospsprint | |
# remove fix container generated | |
podman rm -f fix | |
# redeploy and catch debug traces |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scp memcache.py hberaud@file.cdg.redhat.com:public_html/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export OS_PROJECT_DOMAIN_NAME='Default' | |
export OS_USER_DOMAIN_NAME='Default' | |
export OS_PROJECT_NAME='admin' | |
export OS_USERNAME='admin' | |
export OS_AUTH_URL=http://192.168.24.2:5000/ | |
export OS_AUTH_TYPE='password' | |
export OS_IDENTITY_API_VERSION='3' | |
export OS_PASSWORD=$(hiera -c /etc/puppet/hiera.yaml keystone::admin_password) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
containers_total=${1:-100} | |
containers_concur=${2:-10} | |
container_image=${3:-docker.io/library/busybox} | |
podman pull $container_image | |
docker pull $container_image | |
rm -f bench-jobs.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
generated from /usr/share/openstack-tripleo-heat-templates *and* /usr/share/openstack-puppet/modules/tripleo | |
edit this file /usr/share/openstack-puppet/modules/tripleo/manifests/profile/base/nova.pp | |
you will see the class '::nova::cache' just change the hardcoded backend there |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from inspect import signature | |
import copy | |
def expected(key, sign): | |
for el in sign.parameters.values(): | |
if key in el.name: | |
return True | |
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ipmitool -I lanplus -H 172.16.0.1 -L ADMINISTRATOR -p 6232 -U admin -R 12 -N 5 -Ppassword power status | |
ipmitool -I lanplus -H 172.16.0.1 -L ADMINISTRATOR -p 6232 -U admin -R 12 -N 5 -Ppassword power off | |
sleep 2 | |
ipmitool -I lanplus -H 172.16.0.1 -L ADMINISTRATOR -p 6232 -U admin -R 12 -N 5 -Ppassword power status |