Skip to content

Instantly share code, notes, and snippets.

View mgagne's full-sized avatar

Mathieu Gagné mgagne

View GitHub Profile
module RSpec::Puppet
module GenericDynamicMatchers
def method_missing(method, *args, &block)
return RSpec::Puppet::ManifestMatchers::CreateGeneric.new("contain_#{args[0]}", args[1], &block) if method == :contain
super
end
end
end
@mgagne
mgagne / Gemfile
Last active December 15, 2016 20:54
source 'https://rubygems.org'
gem 'rake', '~>10.1.0'
gem 'librarian-puppet-simple',
:git => 'git://github.com/bodepd/librarian-puppet-simple.git'
group :development, :test do
gem 'mustache', '0.99.8'
gem 'json_pure', '2.0.1'
gem 'safe_yaml', '~> 1.0.4'
@mgagne
mgagne / tampermonkey.js
Created August 29, 2016 20:29
Zuul Inline Status for Gerrit
// ==UserScript==
// @name Zuul inline
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Enable inline Zuul status
// @author You
// @match https://review.openstack.org/
// @grant GM_addStyle
// ==/UserScript==
/* jshint -W097 */
From: =?UTF-8?q?Mathieu=20Gagn=C3=A9?= <mgagne@iweb.com>
Date: Mon, 11 Apr 2016 22:09:41 -0400
Subject: Add ability to restrict image to specific flavor classes
---
nova/compute/api.py | 28 ++++++++++
nova/tests/unit/compute/test_compute.py | 88 +++++++++++++++++++++++++++++++
2 files changed, 116 insertions(+)
diff --git a/nova/compute/api.py b/nova/compute/api.py
from oslo_config import cfg
from oslo_log import log as logging
from nova import db
from nova.scheduler import filters
isolated_opts = [
cfg.ListOpt('isolated_image_os_type',
default=[],
help='Image os_type to run on isolated host'),
---
- name: default
security_group_rules:
- direction: ingress
ethertype: IPv4
remote_ip_prefix: '0.0.0.0/0'
- direction: ingress
ethertype: IPv6
remote_ip_prefix: '::/0'
@mgagne
mgagne / trigger-zuul-periodic-job.sh
Last active May 15, 2019 12:16
Trigger a Zuul periodic job
./tools/trigger-job.py --job periodic-foobar-proposal --project dev/foobar --pipeline periodic --url https://zuul.example.org/p --logpath /dev/null --newrev refs/heads/master --refname refs/heads/master
@mgagne
mgagne / screenrc
Created July 22, 2016 20:13
Screen
startup_message off
vbell on
hardstatus alwayslastline
hardstatus string '%{= kG}%-Lw%{= kW}%50> %n%f* %t%{= kG}%+Lw%< %{= kG}%-=%c:%s%{-}'
caption string "%?%F%{= Bk}%? %C%A %D %d-%m-%Y %{= kB} %t%= %?%F%{= Bk}%:%{= wk}%? %n "
@mgagne
mgagne / check_zuul_layout.py
Created July 5, 2016 23:00
Check Zuul Layout
#!/usr/bin/env python
from __future__ import print_function
import ConfigParser
import argparse
import os
import sys
import yaml
import yamlordereddictloader
import zuul.lib.connections
#cloud-config
disable_root: false
chpasswd: { expire: false }
user: root
users:
- name: root
gecos: root
inactive: false
system: true
lock_passwd: false