Skip to content

Instantly share code, notes, and snippets.

@mgagne
mgagne / nova-manage-flavor.py
Created September 21, 2015 22:27
Synchronize Nova flavors from YAML definitions
#!/usr/bin/env python
#
# Synchronize Nova flavors using YAML definitions.
#
# Author:
# Mathieu Gagne <[email protected]>
#
# Example:
#
# ---
@mgagne
mgagne / Add-empty-bridge-cleanup-util.patch
Created September 8, 2015 20:33
neutron-linuxbridge-cleanup
From: =?UTF-8?q?Mathieu=20Gagn=C3=A9?= <[email protected]>
Date: Mon, 11 May 2015 15:36:19 -0400
Subject: Add empty bridge cleanup util
---
neutron.egg-info/SOURCES.txt | 1 +
neutron/agent/lb_cleanup_util.py | 49 ++++++++++++++++++++++++++++++++++++++
setup.cfg | 1 +
3 files changed, 51 insertions(+)
create mode 100644 neutron/agent/lb_cleanup_util.py
@mgagne
mgagne / x_forwarded_proto.patch
Last active September 4, 2015 21:02
Add support for X-Forwarded-Proto header
From 16b30640057635cb6172888eec36961c6bcfd305 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mathieu=20Gagne=CC=81?= <[email protected]>
Date: Fri, 4 Sep 2015 16:46:08 -0400
Subject: [PATCH] Add support for X-Forwarded-Proto header
This header allows the application to build proper URLs
when SSL termination is performed upstream.
Change-Id: I22cd74f03adea903c1763a59b5c863e2236db7dc
---
from oslo_log import log
from neutron.common import constants
from neutron.extensions import portbindings
from neutron.plugins.ml2 import driver_api as api
LOG = log.getLogger(__name__)
VIF_TYPE_FOOBAR = 'foobar'
@mgagne
mgagne / Add-attach_interface-and-detach_interface-support-wi.patch
Last active August 29, 2015 14:24
Add attach_interface and detach_interface support for Nova cells (Icehouse)
From: =?UTF-8?q?Mathieu=20Gagn=C3=A9?= <[email protected]>
Date: Fri, 15 May 2015 14:11:10 -0400
Subject: Add attach_interface and detach_interface support with cells
Make sure the API cell is updated when networks are allocated.
Change-Id: Iff24c44f6d8f6e03cfa499795dccd42e5f49f70d
---
.../openstack/compute/contrib/attach_interfaces.py | 7 ++++
.../compute/plugins/v3/attach_interfaces.py | 6 ++++
@mgagne
mgagne / pki_nocatalog.py
Last active September 21, 2015 16:16
A PKI-based token provider without catalog in token_id
"""PKI Token (w/o catalog) Provider"""
import copy
import json
from keystoneclient.common import cms
from keystone.common import environment
from keystone import config
from keystone import exception
@mgagne
mgagne / neutron.md
Last active August 29, 2015 14:18
Neutron configuration files

CentOS 7 - RDO Juno

neutron-server reads:

  • /usr/share/neutron/neutron-dist.conf
  • /etc/neutron/neutron.conf
  • /etc/neutron/plugin.ini

neutron-openvswitch-agent reads:

  • /usr/share/neutron/neutron-dist.conf
require 'spec_helper'
require 'yaml'
vagrant_yaml = YAML.load_file('Vagrantfile.yaml')
vagrant_yaml['hosts'].each do |hostname, config|
describe "#{hostname}" do
let(:node) { hostname }
let(:facts) do
{:environment => 'dev'}
@mgagne
mgagne / Rakefile
Last active August 29, 2015 14:18
Using Puppetfile instead of .fixtures.yml
require 'puppetlabs_spec_helper/rake_tasks'
Rake::Task[:spec_prep].clear
desc "Create the fixtures directory"
task :spec_prep do
FileUtils::mkdir_p("spec/fixtures/modules")
FileUtils::mkdir_p("spec/fixtures/manifests")
FileUtils::touch("spec/fixtures/manifests/site.pp")
sh "librarian-puppet install --path=spec/fixtures/modules"
@mgagne
mgagne / gist:c3d87f63853a66e18448
Created April 1, 2015 17:13
puppet_module_version.rb
#
# puppet_module_version.rb
#
require 'puppet/parser/functions'
Puppet::Parser::Functions.newfunction(:puppet_module_version,
:type => :rvalue,
:doc => <<-EOS
This function parses the module version from Modulefile or metadata.json.