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
apt-get update | |
apt-get install -y linux-headers-virtual | |
apt-get install -y openvswitch-datapath-dkms | |
apt-get install -y openvswitch-switch openvswitch-controller openvswitch-brcompat | |
/etc/init.d/openvswitch-switch start | |
ovs-vsctl add-br br0 | |
sudo ovs-vsctl add-port br0 gre0 -- set interface gre0 type=gre options:remote_ip=10.8.0.3 | |
sudo ovs-vsctl add-port br0 gre1 -- set interface gre1 type=gre options:remote_ip=10.8.0.5 | |
ovs-vsctl add-port br0 test -- set interface test type=internal | |
ifconfig test 172.24.16.1/24 up |
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 os | |
with open('in.py') as infile: | |
data = infile.read() | |
def encode(char, sym): | |
return'+'.join([sym] * ord(char)) | |
def write(outfile, wrap, boc, eoc, sep, sym='1'): | |
text = sep.join([boc + encode(char, sym) + eoc for char in data]) |
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
diff --git a/nova/virt/disk/api.py b/nova/virt/disk/api.py | |
index e55b54f..c733045 100644 | |
--- a/nova/virt/disk/api.py | |
+++ b/nova/virt/disk/api.py | |
@@ -294,7 +294,7 @@ def setup_container(image, container_dir=None, use_cow=False): | |
raise exception.NovaException(img.errors) | |
-def destroy_container(img): | |
+def destroy_container(image, container_dir=None, use_cow=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
# Note, make sure to run nova-manage db sync first to create a sqlite database | |
from nova import db | |
from nova.db.sqlalchemy import models | |
from nova.db.sqlalchemy import session as sess | |
from nova import context | |
from sqlalchemy.orm import joinedload | |
def instance_get_joined(uuid, session): | |
with session.begin(): | |
val = session.query(models.Instance).filter_by(deleted=False).options(joinedload('instance_type')).filter_by(uuid=uuid).first() |
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
diff --git a/nova/network/linux_net.py b/nova/network/linux_net.py | |
index 42fb9cc..a30c767 100644 | |
--- a/nova/network/linux_net.py | |
+++ b/nova/network/linux_net.py | |
@@ -136,6 +136,14 @@ class IptablesTable(object): | |
self.chains = set() | |
self.unwrapped_chains = set() | |
+ def __eq__(self, other): | |
+ return ((self.rules == other.rules) and |
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
#!/usr/bin/env bash | |
# This little script is to make backporting patches easier. | |
# Instructions | |
# ------------ | |
# Make sure that <btranch> exists: | |
# git branch -D <branch> | |
# git checkout -b <branch> origin/<branch> | |
# Grab the file and stick it in your <project> directory: | |
# curl -OL https://raw.github.com/gist/2206428/bp.sh | |
# Make sure the script is runnable: |
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
diff --git a/nova/testing/fake/__init__.py b/nova/testing/fake/__init__.py | |
index d9eebbd..5cdad47 100644 | |
--- a/nova/testing/fake/__init__.py | |
+++ b/nova/testing/fake/__init__.py | |
@@ -1,2 +1 @@ | |
-import memcache | |
import rabbit |
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
diff --git a/nova/api/openstack/compute/contrib/extended_server_attributes.py b/nova/api/openstack/compute/contrib/extended_server_attributes.py | |
index c1c85c6..a4794d7 100644 | |
--- a/nova/api/openstack/compute/contrib/extended_server_attributes.py | |
+++ b/nova/api/openstack/compute/contrib/extended_server_attributes.py | |
@@ -69,7 +69,7 @@ class ExtendedServerAttributesController(wsgi.Controller): | |
context = req.environ['nova.context'] | |
if authorize(context): | |
# Attach our slave template to the response object | |
- resp_obj.attach(xml=ExtendedServerAttributesTemplate()) | |
+ resp_obj.attach(xml=ExtendedServerAttributeTemplate()) |
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
diff --git a/nova/api/openstack/compute/contrib/extended_server_attributes.py b/nova/api/openstack/compute/contrib/extended_server_attributes.py | |
index c1c85c6..a4794d7 100644 | |
--- a/nova/api/openstack/compute/contrib/extended_server_attributes.py | |
+++ b/nova/api/openstack/compute/contrib/extended_server_attributes.py | |
@@ -69,7 +69,7 @@ class ExtendedServerAttributesController(wsgi.Controller): | |
context = req.environ['nova.context'] | |
if authorize(context): | |
# Attach our slave template to the response object | |
- resp_obj.attach(xml=ExtendedServerAttributesTemplate()) | |
+ resp_obj.attach(xml=ExtendedServerAttributeTemplate()) |
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
diff --git a/nova/api/openstack/compute/contrib/extended_server_attributes.py b/nova/api/openstack/compute/contrib/extended_server_attributes.py | |
index c1c85c6..aef578f 100644 | |
--- a/nova/api/openstack/compute/contrib/extended_server_attributes.py | |
+++ b/nova/api/openstack/compute/contrib/extended_server_attributes.py | |
@@ -69,7 +69,7 @@ class ExtendedServerAttributesController(wsgi.Controller): | |
context = req.environ['nova.context'] | |
if authorize(context): | |
# Attach our slave template to the response object | |
- resp_obj.attach(xml=ExtendedServerAttributesTemplate()) | |
+ resp_obj.attach(xml=ExtendedServerAttributeTemplate()) |