Skip to content

Instantly share code, notes, and snippets.

View toabctl's full-sized avatar

Thomas Bechtold toabctl

  • Canonical
  • Berlin/Germany
View GitHub Profile
@toabctl
toabctl / libvirt-listen-events.py
Last active November 2, 2021 10:02
Listen for libvirt events
#!/usr/bin/python
import libvirt
import sys
# virDomainEventType is emitted during domain lifecycles (see libvirt.h)
VIR_DOMAIN_EVENT_MAPPING = {
0: "VIR_DOMAIN_EVENT_DEFINED",
1: "VIR_DOMAIN_EVENT_UNDEFINED",
2: "VIR_DOMAIN_EVENT_STARTED",
@toabctl
toabctl / manila.conf.example
Created August 18, 2014 14:00
Example configuration for OpenStack Manila
[DEFAULT]
rabbit_host=192.168.142.81
rabbit_port=5672
rabbit_userid=nova
rabbit_password=secret
rabbit_virtual_host=/nova
control_exchange=manila
osapi_share_listen=0.0.0.0
osapi_share_listen_port=8786
sql_connection=sqlite:////var/lib/manila/manila.db
#!/usr/bin/python
from __future__ import print_function
import argparse
import logging
import collections
import os
import json
import requests
#!/bin/bash
zypper="zypper -n"
$zypper ar -f 'http://smt-internal.opensuse.org/repo/$RCE/SUSE/Products/SLE-SERVER/12/x86_64/product' product
$zypper ar -f 'http://smt-internal.opensuse.org/repo/$RCE/SUSE/Updates/SLE-SERVER/12/x86_64/update/' updates
$zypper ar -f 'http://smt-internal.opensuse.org/repo/$RCE/SUSE/Products/SLE-SDK/12/x86_64/product/' SDK
$zypper ar -f 'http://smt-internal.opensuse.org/repo/$RCE/SUSE/Updates/SLE-SDK/12/x86_64/update/' SDK-update
$zypper ar -f http://download.opensuse.org/repositories/home:/tbechtold:/contrail/SLE_12/home:tbechtold:contrail.repo
$zypper ar -f http://download.opensuse.org/repositories/devel:/tools:/building/SLE_12/devel:tools:building.repo # for google's protobuf
#!/usr/bin/python
# Author: Thomas Bechtold <tbechtold@suse.com>
from __future__ import print_function
import os
import sys
import argparse
import requests
@toabctl
toabctl / tmpl2spec.py
Last active September 14, 2015 12:51
#!/usr/bin/python
from __future__ import print_function
import argparse
import os
from jinja2 import Environment, Template, FileSystemLoader
from yaml import load, Loader
###############
#!/usr/bin/python
# Copyright (c) 2016 SUSE Linux GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
#!/bin/bash
tmpdir=~/tmp/
jenkins_url=https://ci.suse.de/
buildjob=$1
buildnumber=$2
builddir=$tmpdir/ci-logs/$buildjob/ci-$buildnumber/
if ! [ -e "$builddir" ]; then
echo "mkdir"
@toabctl
toabctl / render-testbuild
Last active August 22, 2016 13:27
Use renderspec and OBS to run a quick local build
#!/bin/bash
# Author: Thomas Bechtold <tbechtold@suse.com>
# Requirements:
# - obs-service-download_files from https://build.opensuse.org/project/show/openSUSE:Tools
# - rpm-packaging git repo checkout (https://github.com/openstack/rpm-packaging) under BASE_RPM_PACKAGING
# - Cloud:OpenStack:Upstream:Master checkout (https://build.opensuse.org/project/show/Cloud:OpenStack:Upstream:Master)
# under BASE_OBS_PROJECT
# pymod2pkg installation (https://pypi.python.org/pypi/pymod2pkg or https://build.opensuse.org/package/show/devel:languages:python/python-pymod2pkg)
#!/bin/bash
set -xe
pypi_name=$1
BASE_OBS_PROJECT=~/devel/bs/pub/Cloud:OpenStack:Upstream
BASE_RPM_PACKAGING=~/devel/openstack/rpm-packaging
pushd $BASE_OBS_PROJECT