Skip to content

Instantly share code, notes, and snippets.

View mgagne's full-sized avatar

Mathieu Gagné mgagne

View GitHub Profile
@mgagne
mgagne / aggregate_image_os_type_isolation.py
Created April 30, 2018 16:25
Strict image isolation for Nova - Mitaka
# All Rights Reserved.
#
# 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
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
{
"compute:attach_volume": "rule:os_compute_api:os-volumes-attachments:create",
"compute:confirm_resize": "rule:os_compute_api:servers:confirm_resize",
"compute:create": "rule:os_compute_api:servers:create",
"compute:delete": "rule:os_compute_api:servers:delete",
"compute:detach_volume": "rule:os_compute_api:os-volumes-attachments:delete",
"compute:reboot": "rule:os_compute_api:servers:reboot",
"compute:rebuild": "rule:os_compute_api:servers:rebuild",
"compute:resize": "rule:os_compute_api:servers:resize",
"compute:revert_resize": "rule:os_compute_api:servers:revert_resize",
commit 91bc0ed7d25dd6efeeb820ca7cbb1f2af3bd53ab (HEAD -> newton/placement-roles)
Author: Mathieu Gagné <mgagne@iweb.com>
Date: Thu Nov 30 18:03:22 2017 -0500
Add ability to override roles allowed to query placement API
Change-Id: I37ac6964a5852aac129107e9be476785ea713fae
diff --git a/nova/api/openstack/placement/handler.py b/nova/api/openstack/placement/handler.py
index 7d41031e37..f1bf225540 100644
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 / 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 "