[openstack-nova] Add ~20 significant fixes from upstream stable branch

Mark McLoughlin markmc at fedoraproject.org
Mon Nov 14 14:31:28 UTC 2011


commit 85dc6af7cd980c75fd872381a1ed0ece54987bfe
Author: Mark McLoughlin <markmc at redhat.com>
Date:   Mon Nov 14 14:29:56 2011 +0000

    Add ~20 significant fixes from upstream stable branch

 0001-Add-tools-rfc.sh-from-master.patch            |  175 +++++
 0002-Don-t-use-GitPython-for-authors-check.patch   |   81 +++
 ...Made-jenkins-email-pruning-more-resilient.patch |   28 +
 0004-Removing-old-code-that-snuck-back-in.patch    |   77 +++
 ...outstanding-pep8-errors-for-a-clean-trunk.patch |  675 ++++++++++++++++++++
 0006-Point-tools-rfc.sh-at-the-right-branch.patch  |   26 +
 ...kes-sure-to-recreate-gateway-for-moved-ip.patch |    7 +-
 ...y-qualified-domain-name-in-local-hostname.patch |  103 +++
 ...e-grantee-group-loading-for-source-groups.patch |    8 +-
 ...ders-when-auth_token-is-None.-Fixes-bug-8.patch |   29 +
 ...pool-complexities-from-nova.db.sqlalchemy.patch |    7 +-
 0012-Raise-InsufficientFreeMemory.patch            |   69 ++
 0013-Don-t-leak-exceptions-out-to-users.patch      |   36 +
 ...snapshots-work-for-amis.-Fixes-bug-873156.patch |  166 +++++
 0015-Add-missing-author.patch                      |   25 +
 0016-Make-snapshots-private-by-default.patch       |   30 +
 ...ackups-can-no-longer-happen-simultaneousl.patch |  196 ++++++
 ...lp850602.patch => 0018-Fixed-bug-lp850602.patch |   10 +-
 0019-bug-861310.patch                              |   31 +
 0020-Enforce-snapshot-cleanup.patch                |   90 +++
 0021-bug-lp845714.patch                            |  100 +++
 ...-version-specifier-to-kombu-in-pip-requir.patch |   31 +
 ...nant-id-to-the-create-images-response-Loc.patch |   55 ++
 ...-bug-862633-OS-api-consoles-create-broken.patch |  270 ++++++++
 0025-Deallocate-ip-if-build-fails.patch            |  159 +++++
 ...p-returning-correct-password-on-api-calls.patch |   11 +-
 0027-Handle-pidfile-exception-for-dnsmasq.patch    |   51 ++
 0028-Make-sure-unknown-extensions-return-404.patch |   58 ++
 ...ginal-exception-in-ClassNotFound-exceptio.patch |   93 +++
 ...default-FLAGS.logfile_mode-is-properly-co.patch |   49 ++
 ...t-errors-on-confirm-revertResize-failures.patch |   88 +++
 ...ds-ext4-and-reiserfs-to-_mount_filesystem.patch |   30 +
 0033-Improve-access-check-on-images.patch          |   82 +++
 ...es-bug-834633-Auto-assigning-floating-IPs.patch |   62 ++
 0035-fixes-bug-883233.patch                        |   44 ++
 ...hain-rule-for-EC2-metadata-requests-lp-85.patch |    9 +-
 ...pi-add-the-INPUT-rule-for-EC2-metadata-lp.patch |   12 +-
 ...ser-to-choose-either-ietadm-or-tgtadm-lp-.patch |    7 +-
 ...e-VolumeDriver.sync_exec-method-lp-819997.patch |    4 +-
 ...tadm-tgtadm-calls-out-into-helper-classes.patch |    6 +-
 openstack-nova.spec                                |  111 +++-
 41 files changed, 3143 insertions(+), 58 deletions(-)
---
diff --git a/0001-Add-tools-rfc.sh-from-master.patch b/0001-Add-tools-rfc.sh-from-master.patch
new file mode 100644
index 0000000..073d276
--- /dev/null
+++ b/0001-Add-tools-rfc.sh-from-master.patch
@@ -0,0 +1,175 @@
+From 3a63bd53aa0e37c1ba5520b4031b2d1293592263 Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Wed, 12 Oct 2011 13:46:02 +0100
+Subject: [PATCH 01/40] Add tools/rfc.sh from master
+
+We'll be managing the diablo branch using gerrit, so we'll need this
+script.
+
+Take the latest version because there have been some tweaks since.
+
+Change-Id: Idd2f2f3693b0a5d612bf861d96621feb622e0f5c
+---
+ tools/rfc.sh |  150 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 150 insertions(+), 0 deletions(-)
+ create mode 100755 tools/rfc.sh
+
+diff --git a/tools/rfc.sh b/tools/rfc.sh
+new file mode 100755
+index 0000000..0c578f1
+--- /dev/null
++++ b/tools/rfc.sh
+@@ -0,0 +1,150 @@
++#!/bin/sh -e
++# Copyright (c) 2010-2011 Gluster, Inc. <http://www.gluster.com>
++# This initial version of this file was taken from the source tree
++# of GlusterFS. It was not directly attributed, but is assumed to be
++# Copyright (c) 2010-2011 Gluster, Inc and release GPLv3
++# Subsequent modifications are Copyright (c) 2011 OpenStack, LLC.
++#
++# GlusterFS is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published
++# by the Free Software Foundation; either version 3 of the License,
++# or (at your option) any later version.
++#
++# GlusterFS is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++# General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see
++# <http://www.gnu.org/licenses/>.
++
++
++branch="master";
++
++set_hooks_commit_msg()
++{
++    top_dir=`git rev-parse --show-toplevel`
++    f="${top_dir}/.git/hooks/commit-msg";
++    u="https://review.openstack.org/tools/hooks/commit-msg";
++
++    if [ -x "$f" ]; then
++        return;
++    fi
++
++    curl -o $f $u || wget -O $f $u;
++
++    chmod +x $f;
++
++    GIT_EDITOR=true git commit --amend
++}
++
++add_remote()
++{
++    username=$1
++    project=$2
++
++    echo "No remote set, testing ssh://$username@review.openstack.org:29418"
++    if project_list=`ssh -p29418 -o StrictHostKeyChecking=no $username at review.openstack.org gerrit ls-projects 2>/dev/null`
++    then
++        echo "$username at review.openstack.org:29418 worked."
++        if echo $project_list | grep -w "${project%.git}" >/dev/null
++        then
++            echo "Creating a git remote called gerrit that maps to:"
++            echo "  ssh://$username@review.openstack.org:29418/$project"
++            git remote add gerrit ssh://$username@review.openstack.org:29418/$project
++        else
++            echo "The current project name, ${project%.git}, is not a known project."
++            echo "Please either reclone from github/gerrit or create a"
++            echo "remote named gerrit that points to the intended project."
++            return 1
++        fi
++
++        return 0
++    fi
++    return 1
++}
++
++check_remote()
++{
++    if [ -z "$USERNAME" ]
++    then
++      USERNAME=`git config review.username`
++    fi
++
++    if ! git remote | grep gerrit >/dev/null 2>&1
++    then
++        origin_project=`git remote show origin | grep 'Fetch URL' | perl -nle '@fields = split(m|[:/]|); $len = $#fields; print $fields[$len-1], "/", $fields[$len];'`
++        if add_remote $USERNAME $origin_project
++        then
++            return 0
++        else
++            echo "Your local name doesn't work on Gerrit."
++            echo -n "Enter Gerrit username (same as launchpad): "
++            read gerrit_user
++            if add_remote $gerrit_user $origin_project
++            then
++                return 0
++            else
++                echo "Can't infer where gerrit is - please set a remote named"
++                echo "gerrit manually and then try again."
++                echo
++                echo "For more information, please see:"
++                echo "\thttp://wiki.openstack.org/GerritWorkflow"
++                exit 1
++            fi
++        fi
++    fi
++}
++
++rebase_changes()
++{
++    git fetch;
++
++    GIT_EDITOR=true git rebase -i origin/$branch || exit $?;
++}
++
++
++assert_diverge()
++{
++    if ! git diff origin/$branch..HEAD | grep -q .
++    then
++	echo "No changes between the current branch and origin/$branch."
++	exit 1
++    fi
++}
++
++
++main()
++{
++    set_hooks_commit_msg;
++
++    check_remote;
++
++    rebase_changes;
++
++    assert_diverge;
++
++    bug=$(git show --format='%s %b' | perl -nle 'if (/\b([Bb]ug|[Ll][Pp])\s*[#:]?\s*(\d+)/) {print "$2"; exit}')
++
++    bp=$(git show --format='%s %b' | perl -nle 'if (/\b([Bb]lue[Pp]rint|[Bb][Pp])\s*[#:]?\s*([0-9a-zA-Z-_]+)/) {print "$2"; exit}')
++
++    if [ "$DRY_RUN" = 1 ]; then
++        drier='echo -e Please use the following command to send your commits to review:\n\n'
++    else
++        drier=
++    fi
++
++    local_branch=`git branch | grep -Ei "\* (.*)" | cut -f2 -d' '`
++    if [ -z "$bug" ]; then
++	if [ -z "$bp" ]; then
++            $drier git push gerrit HEAD:refs/for/$branch/$local_branch;
++	else
++	    $drier git push gerrit HEAD:refs/for/$branch/bp/$bp;
++	fi
++    else
++        $drier git push gerrit HEAD:refs/for/$branch/bug/$bug;
++    fi
++}
++
++main "$@"
+-- 
+1.7.6.4
+
diff --git a/0002-Don-t-use-GitPython-for-authors-check.patch b/0002-Don-t-use-GitPython-for-authors-check.patch
new file mode 100644
index 0000000..c2c113c
--- /dev/null
+++ b/0002-Don-t-use-GitPython-for-authors-check.patch
@@ -0,0 +1,81 @@
+From ba68a78d440269ac21f16cb19b4fd3ba8949c945 Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Fri, 23 Sep 2011 15:57:55 +0100
+Subject: [PATCH 02/40] Don't use GitPython for authors check
+
+I hit this issue with an older GitPython version:
+
+  https://bugzilla.redhat.com/740852
+
+Seeing as all GitPython is doing for us is running:
+
+  $> git rev-list --pretty=raw HEAD
+
+and parsing the output, I figure it's just as easy for us to run git
+directly.
+
+(cherry picked from commit affabf5be4db8b15974bb9ce4c16b0a8242e1fc2)
+
+Change-Id: I14e73918bde741c4d7cc471f54aa468b3f344631
+---
+ nova/tests/test_misc.py |   15 +++++----------
+ tools/pip-requires      |    2 --
+ 2 files changed, 5 insertions(+), 12 deletions(-)
+
+diff --git a/nova/tests/test_misc.py b/nova/tests/test_misc.py
+index c5875a8..45c4965 100644
+--- a/nova/tests/test_misc.py
++++ b/nova/tests/test_misc.py
+@@ -14,6 +14,7 @@
+ #    License for the specific language governing permissions and limitations
+ #    under the License.
+ 
++import commands
+ import errno
+ import os
+ import select
+@@ -67,19 +68,13 @@ class ProjectTestCase(test.TestCase):
+                 tree.unlock()
+ 
+         elif os.path.exists(os.path.join(topdir, '.git')):
+-            import git
+-            repo = git.Repo(topdir)
+-            for commit in repo.head.commit.iter_parents():
+-                email = commit.author.email
+-                if email is None:
+-                    email = commit.author.name
+-                if 'nova-core' in email:
++            for email in commands.getoutput('git log --format=%ae').split():
++                if not email:
++                    continue
++                if "jenkins at review.openstack.org" in email:
+                     continue
+-                if email.split(' ')[-1] == '<>':
+-                    email = email.split(' ')[-2]
+                 email = '<' + email + '>'
+                 contributors.add(str_dict_replace(email, mailmap))
+-
+         else:
+             return
+ 
+diff --git a/tools/pip-requires b/tools/pip-requires
+index 66d6a48..232887c 100644
+--- a/tools/pip-requires
++++ b/tools/pip-requires
+@@ -21,7 +21,6 @@ wsgiref==0.1.2
+ mox==0.5.3
+ greenlet==0.3.1
+ nose
+-bzr
+ PasteDeploy
+ paste
+ sqlalchemy-migrate
+@@ -33,5 +32,4 @@ nova-adminclient
+ suds==0.4
+ coverage
+ nosexcover
+-GitPython
+ paramiko
+-- 
+1.7.6.4
+
diff --git a/0003-Made-jenkins-email-pruning-more-resilient.patch b/0003-Made-jenkins-email-pruning-more-resilient.patch
new file mode 100644
index 0000000..67b0277
--- /dev/null
+++ b/0003-Made-jenkins-email-pruning-more-resilient.patch
@@ -0,0 +1,28 @@
+From 6503923b235590e363d366375f3d2747e4d516b1 Mon Sep 17 00:00:00 2001
+From: Monty Taylor <mordred at inaugust.com>
+Date: Fri, 23 Sep 2011 17:37:29 -0400
+Subject: [PATCH 03/40] Made jenkins email pruning more resilient.
+
+(cherry picked from commit c586e4ed23846420177802c164f594e021cceea8)
+
+Change-Id: I8293ec3ab55735d484b617d0b1612f4bf6f3105e
+---
+ nova/tests/test_misc.py |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/nova/tests/test_misc.py b/nova/tests/test_misc.py
+index 45c4965..f30a1bf 100644
+--- a/nova/tests/test_misc.py
++++ b/nova/tests/test_misc.py
+@@ -71,7 +71,7 @@ class ProjectTestCase(test.TestCase):
+             for email in commands.getoutput('git log --format=%ae').split():
+                 if not email:
+                     continue
+-                if "jenkins at review.openstack.org" in email:
++                if "jenkins" in email and "openstack.org" in email:
+                     continue
+                 email = '<' + email + '>'
+                 contributors.add(str_dict_replace(email, mailmap))
+-- 
+1.7.6.4
+
diff --git a/0004-Removing-old-code-that-snuck-back-in.patch b/0004-Removing-old-code-that-snuck-back-in.patch
new file mode 100644
index 0000000..ae1b9e3
--- /dev/null
+++ b/0004-Removing-old-code-that-snuck-back-in.patch
@@ -0,0 +1,77 @@
+From b0e855e504d2c7b5f7b50f436e43a27ec05e5a46 Mon Sep 17 00:00:00 2001
+From: Brian Waldon <brian.waldon at rackspace.com>
+Date: Fri, 23 Sep 2011 10:35:18 -0400
+Subject: [PATCH 04/40] Removing old code that snuck back in
+
+(cherry picked from commit 7a95f73ad7b295ddd2313152973c6da2c78fac76)
+
+Change-Id: Ia0b0ed9a12e73b828be3cb2c491ebc39c15ece34
+---
+ nova/api/openstack/_id_translator.py       |   42 ----------------------------
+ nova/api/rackspace/controllers/__init__.py |    5 ---
+ 2 files changed, 0 insertions(+), 47 deletions(-)
+ delete mode 100644 nova/api/openstack/_id_translator.py
+ delete mode 100644 nova/api/rackspace/controllers/__init__.py
+
+diff --git a/nova/api/openstack/_id_translator.py b/nova/api/openstack/_id_translator.py
+deleted file mode 100644
+index 333aa84..0000000
+--- a/nova/api/openstack/_id_translator.py
++++ /dev/null
+@@ -1,42 +0,0 @@
+-from nova import datastore
+-
+-class RackspaceAPIIdTranslator(object):
+-    """
+-    Converts Rackspace API ids to and from the id format for a given
+-    strategy.
+-    """
+-
+-    def __init__(self, id_type, service_name):
+-        """
+-        Creates a translator for ids of the given type (e.g. 'flavor'), for the
+-        given storage service backend class name (e.g. 'LocalFlavorService').
+-        """
+-
+-        self._store = datastore.Redis.instance()
+-        key_prefix = "rsapi.idtranslator.%s.%s" % (id_type, service_name)
+-        # Forward (strategy format -> RS format) and reverse translation keys
+-        self._fwd_key = "%s.fwd" % key_prefix
+-        self._rev_key = "%s.rev" % key_prefix
+-
+-    def to_rs_id(self, opaque_id):
+-        """Convert an id from a strategy-specific one to a Rackspace one."""
+-        result = self._store.hget(self._fwd_key, str(opaque_id))
+-        if result: # we have a mapping from opaque to RS for this strategy
+-            return int(result)
+-        else:
+-            # Store the mapping.
+-            nextid = self._store.incr("%s.lastid" % self._fwd_key)
+-            if self._store.hsetnx(self._fwd_key, str(opaque_id), nextid):
+-                # If someone else didn't beat us to it, store the reverse
+-                # mapping as well.
+-                self._store.hset(self._rev_key, nextid, str(opaque_id))
+-                return nextid
+-            else:
+-                # Someone beat us to it; use their number instead, and
+-                # discard nextid (which is OK -- we don't require that
+-                # every int id be used.)
+-                return int(self._store.hget(self._fwd_key, str(opaque_id)))
+-
+-    def from_rs_id(self, rs_id):
+-        """Convert a Rackspace id to a strategy-specific one."""
+-        return self._store.hget(self._rev_key, rs_id)
+diff --git a/nova/api/rackspace/controllers/__init__.py b/nova/api/rackspace/controllers/__init__.py
+deleted file mode 100644
+index 052b6f3..0000000
+--- a/nova/api/rackspace/controllers/__init__.py
++++ /dev/null
+@@ -1,5 +0,0 @@
+-from nova.endpoint.rackspace.controllers.images import ImagesController
+-from nova.endpoint.rackspace.controllers.flavors import FlavorsController
+-from nova.endpoint.rackspace.controllers.servers import ServersController
+-from nova.endpoint.rackspace.controllers.sharedipgroups import \
+-        SharedIpGroupsController
+-- 
+1.7.6.4
+
diff --git a/0005-Fix-outstanding-pep8-errors-for-a-clean-trunk.patch b/0005-Fix-outstanding-pep8-errors-for-a-clean-trunk.patch
new file mode 100644
index 0000000..e32fd2c
--- /dev/null
+++ b/0005-Fix-outstanding-pep8-errors-for-a-clean-trunk.patch
@@ -0,0 +1,675 @@
+From d6137fb2442ad1f0e675deeb33e5cc456574e7d6 Mon Sep 17 00:00:00 2001
+From: Monty Taylor <mordred at inaugust.com>
+Date: Thu, 22 Sep 2011 18:22:42 -0400
+Subject: [PATCH 05/40] Fix outstanding pep8 errors for a clean trunk.
+
+Also, add an option to run_tests.sh to skip running pep8. We have a separate
+job in Jenkins which runs pep8, so there's no need to spin our wheels on it
+during the test run.
+
+(cherry picked from commit 21dcf669c72fddc7b26018388e678fe0b033e318)
+
+Change-Id: I8b0185ad974bc1242ebbe0b9570d966dcbf60f1e
+---
+ nova/api/openstack/ips.py                          |    2 +-
+ nova/compute/manager.py                            |    4 +-
+ .../sqlalchemy/migrate_repo/versions/001_austin.py |   24 ++++++++++----------
+ .../sqlalchemy/migrate_repo/versions/002_bexar.py  |   18 +++++++-------
+ .../versions/003_add_label_to_networks.py          |    2 +-
+ .../migrate_repo/versions/004_add_zone_tables.py   |    2 +-
+ .../versions/005_add_instance_metadata.py          |    2 +-
+ .../versions/008_add_instance_types.py             |   16 ++++++------
+ .../versions/009_add_instance_migrations.py        |    2 +-
+ .../versions/010_add_os_type_to_instances.py       |    2 +-
+ .../migrate_repo/versions/011_live_migration.py    |    4 +-
+ .../versions/012_add_ipv6_flatmanager.py           |    6 ++--
+ .../014_add_instance_type_id_to_instances.py       |    2 +-
+ .../versions/019_add_volume_snapshot_support.py    |    2 +-
+ .../versions/024_add_block_device_mapping.py       |    4 +-
+ .../migrate_repo/versions/026_add_agent_table.py   |    2 +-
+ .../versions/027_add_provider_firewall_rules.py    |    8 +++---
+ .../versions/029_add_zone_weight_offsets.py        |    2 +-
+ .../migrate_repo/versions/030_multi_nic.py         |    2 +-
+ .../versions/042_add_volume_types_and_extradata.py |    2 +-
+ nova/tests/api/openstack/test_flavors.py           |    6 +++-
+ nova/tests/api/openstack/test_servers.py           |    2 +-
+ nova/tests/scheduler/test_scheduler.py             |    2 +-
+ nova/tests/test_libvirt.py                         |   16 ++++++------
+ nova/tests/test_network.py                         |    2 +-
+ run_tests.sh                                       |   10 ++++++-
+ 26 files changed, 77 insertions(+), 69 deletions(-)
+
+diff --git a/nova/api/openstack/ips.py b/nova/api/openstack/ips.py
+index a74fae4..68d9218 100644
+--- a/nova/api/openstack/ips.py
++++ b/nova/api/openstack/ips.py
+@@ -148,7 +148,7 @@ def create_resource(version):
+ 
+     metadata = {
+         'list_collections': {
+-            'public':  {'item_name': 'ip', 'item_key': 'addr'},
++            'public': {'item_name': 'ip', 'item_key': 'addr'},
+             'private': {'item_name': 'ip', 'item_key': 'addr'},
+         },
+     }
+diff --git a/nova/compute/manager.py b/nova/compute/manager.py
+index 25d44e5..e575402 100644
+--- a/nova/compute/manager.py
++++ b/nova/compute/manager.py
+@@ -939,10 +939,10 @@ class ComputeManager(manager.SchedulerDependentManager):
+                 {'instance_uuid': instance_ref['uuid'],
+                  'source_compute': instance_ref['host'],
+                  'dest_compute': FLAGS.host,
+-                 'dest_host':   self.driver.get_host_ip_addr(),
++                 'dest_host': self.driver.get_host_ip_addr(),
+                  'old_instance_type_id': old_instance_type['id'],
+                  'new_instance_type_id': instance_type_id,
+-                 'status':      'pre-migrating'})
++                 'status': 'pre-migrating'})
+ 
+         LOG.audit(_('instance %s: migrating'), instance_ref['uuid'],
+                 context=context)
+diff --git a/nova/db/sqlalchemy/migrate_repo/versions/001_austin.py b/nova/db/sqlalchemy/migrate_repo/versions/001_austin.py
+index 63bbacc..46ceb8b 100644
+--- a/nova/db/sqlalchemy/migrate_repo/versions/001_austin.py
++++ b/nova/db/sqlalchemy/migrate_repo/versions/001_austin.py
+@@ -52,7 +52,7 @@ export_devices = Table('export_devices', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('shelf_id', Integer()),
+         Column('blade_id', Integer()),
+         Column('volume_id',
+@@ -67,7 +67,7 @@ fixed_ips = Table('fixed_ips', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('address',
+                String(length=255, convert_unicode=False, assert_unicode=None,
+                       unicode_error=None, _warn_on_bytestring=False)),
+@@ -90,7 +90,7 @@ floating_ips = Table('floating_ips', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('address',
+                String(length=255, convert_unicode=False, assert_unicode=None,
+                       unicode_error=None, _warn_on_bytestring=False)),
+@@ -112,7 +112,7 @@ instances = Table('instances', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('internal_id', Integer()),
+         Column('admin_pass',
+                String(length=255, convert_unicode=False, assert_unicode=None,
+@@ -184,7 +184,7 @@ key_pairs = Table('key_pairs', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('name',
+                String(length=255, convert_unicode=False, assert_unicode=None,
+                       unicode_error=None, _warn_on_bytestring=False)),
+@@ -205,7 +205,7 @@ networks = Table('networks', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('injected', Boolean(create_constraint=True, name=None)),
+         Column('cidr',
+                String(length=255, convert_unicode=False, assert_unicode=None,
+@@ -273,7 +273,7 @@ quotas = Table('quotas', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('project_id',
+                String(length=255, convert_unicode=False, assert_unicode=None,
+                       unicode_error=None, _warn_on_bytestring=False)),
+@@ -290,7 +290,7 @@ security_groups = Table('security_groups', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('name',
+                String(length=255, convert_unicode=False, assert_unicode=None,
+                       unicode_error=None, _warn_on_bytestring=False)),
+@@ -324,7 +324,7 @@ security_group_rules = Table('security_group_rules', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('parent_group_id',
+                Integer(),
+                ForeignKey('security_groups.id')),
+@@ -347,7 +347,7 @@ services = Table('services', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('host',
+                String(length=255, convert_unicode=False, assert_unicode=None,
+                       unicode_error=None, _warn_on_bytestring=False)),
+@@ -357,7 +357,7 @@ services = Table('services', meta,
+         Column('topic',
+                String(length=255, convert_unicode=False, assert_unicode=None,
+                       unicode_error=None, _warn_on_bytestring=False)),
+-        Column('report_count', Integer(),  nullable=False),
++        Column('report_count', Integer(), nullable=False),
+         Column('disabled', Boolean(create_constraint=True, name=None)),
+         )
+ 
+@@ -456,7 +456,7 @@ volumes = Table('volumes', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('ec2_id',
+                String(length=255, convert_unicode=False, assert_unicode=None,
+                       unicode_error=None, _warn_on_bytestring=False)),
+diff --git a/nova/db/sqlalchemy/migrate_repo/versions/002_bexar.py b/nova/db/sqlalchemy/migrate_repo/versions/002_bexar.py
+index 9bb8a8a..f8ac9f6 100644
+--- a/nova/db/sqlalchemy/migrate_repo/versions/002_bexar.py
++++ b/nova/db/sqlalchemy/migrate_repo/versions/002_bexar.py
+@@ -25,21 +25,21 @@ meta = MetaData()
+ # Just for the ForeignKey and column creation to succeed, these are not the
+ # actual definitions of instances or services.
+ instances = Table('instances', meta,
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         )
+ 
+ 
+ services = Table('services', meta,
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         )
+ 
+ 
+ networks = Table('networks', meta,
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         )
+ 
+ volumes = Table('volumes', meta,
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         )
+ 
+ 
+@@ -51,7 +51,7 @@ certificates = Table('certificates', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('user_id',
+                String(length=255, convert_unicode=False, assert_unicode=None,
+                       unicode_error=None, _warn_on_bytestring=False)),
+@@ -69,7 +69,7 @@ consoles = Table('consoles', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('instance_name',
+                String(length=255, convert_unicode=False, assert_unicode=None,
+                       unicode_error=None, _warn_on_bytestring=False)),
+@@ -89,7 +89,7 @@ console_pools = Table('console_pools', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('address',
+                String(length=255, convert_unicode=False, assert_unicode=None,
+                       unicode_error=None, _warn_on_bytestring=False)),
+@@ -119,7 +119,7 @@ instance_actions = Table('instance_actions', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('instance_id',
+                Integer(),
+                ForeignKey('instances.id')),
+@@ -137,7 +137,7 @@ iscsi_targets = Table('iscsi_targets', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('target_num', Integer()),
+         Column('host',
+                String(length=255, convert_unicode=False, assert_unicode=None,
+diff --git a/nova/db/sqlalchemy/migrate_repo/versions/003_add_label_to_networks.py b/nova/db/sqlalchemy/migrate_repo/versions/003_add_label_to_networks.py
+index 8e0de4d..85a4563 100644
+--- a/nova/db/sqlalchemy/migrate_repo/versions/003_add_label_to_networks.py
++++ b/nova/db/sqlalchemy/migrate_repo/versions/003_add_label_to_networks.py
+@@ -20,7 +20,7 @@ from sqlalchemy import Column, Integer, MetaData, String, Table
+ meta = MetaData()
+ 
+ networks = Table('networks', meta,
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         )
+ 
+ 
+diff --git a/nova/db/sqlalchemy/migrate_repo/versions/004_add_zone_tables.py b/nova/db/sqlalchemy/migrate_repo/versions/004_add_zone_tables.py
+index 0abea37..9c2aeba 100644
+--- a/nova/db/sqlalchemy/migrate_repo/versions/004_add_zone_tables.py
++++ b/nova/db/sqlalchemy/migrate_repo/versions/004_add_zone_tables.py
+@@ -27,7 +27,7 @@ zones = Table('zones', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('api_url',
+                String(length=255, convert_unicode=False, assert_unicode=None,
+                       unicode_error=None, _warn_on_bytestring=False)),
+diff --git a/nova/db/sqlalchemy/migrate_repo/versions/005_add_instance_metadata.py b/nova/db/sqlalchemy/migrate_repo/versions/005_add_instance_metadata.py
+index a1a86e3..5e3d09e 100644
+--- a/nova/db/sqlalchemy/migrate_repo/versions/005_add_instance_metadata.py
++++ b/nova/db/sqlalchemy/migrate_repo/versions/005_add_instance_metadata.py
+@@ -28,7 +28,7 @@ instances = Table('instances', meta,
+         )
+ 
+ quotas = Table('quotas', meta,
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         )
+ 
+ 
+diff --git a/nova/db/sqlalchemy/migrate_repo/versions/008_add_instance_types.py b/nova/db/sqlalchemy/migrate_repo/versions/008_add_instance_types.py
+index 63999f6..c8372e0 100644
+--- a/nova/db/sqlalchemy/migrate_repo/versions/008_add_instance_types.py
++++ b/nova/db/sqlalchemy/migrate_repo/versions/008_add_instance_types.py
+@@ -32,14 +32,14 @@ instance_types = Table('instance_types', meta,
+                String(length=255, convert_unicode=False, assert_unicode=None,
+                       unicode_error=None, _warn_on_bytestring=False),
+                       unique=True),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
+-        Column('memory_mb', Integer(),  nullable=False),
+-        Column('vcpus', Integer(),  nullable=False),
+-        Column('local_gb', Integer(),  nullable=False),
+-        Column('flavorid', Integer(),  nullable=False, unique=True),
+-        Column('swap', Integer(),  nullable=False, default=0),
+-        Column('rxtx_quota', Integer(),  nullable=False, default=0),
+-        Column('rxtx_cap', Integer(),  nullable=False, default=0))
++        Column('id', Integer(), primary_key=True, nullable=False),
++        Column('memory_mb', Integer(), nullable=False),
++        Column('vcpus', Integer(), nullable=False),
++        Column('local_gb', Integer(), nullable=False),
++        Column('flavorid', Integer(), nullable=False, unique=True),
++        Column('swap', Integer(), nullable=False, default=0),
++        Column('rxtx_quota', Integer(), nullable=False, default=0),
++        Column('rxtx_cap', Integer(), nullable=False, default=0))
+ 
+ 
+ def upgrade(migrate_engine):
+diff --git a/nova/db/sqlalchemy/migrate_repo/versions/009_add_instance_migrations.py b/nova/db/sqlalchemy/migrate_repo/versions/009_add_instance_migrations.py
+index 0f2d007..2938bd5 100644
+--- a/nova/db/sqlalchemy/migrate_repo/versions/009_add_instance_migrations.py
++++ b/nova/db/sqlalchemy/migrate_repo/versions/009_add_instance_migrations.py
+@@ -24,7 +24,7 @@ meta = MetaData()
+ # Just for the ForeignKey and column creation to succeed, these are not the
+ # actual definitions of instances or services.
+ instances = Table('instances', meta,
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         )
+ 
+ #
+diff --git a/nova/db/sqlalchemy/migrate_repo/versions/010_add_os_type_to_instances.py b/nova/db/sqlalchemy/migrate_repo/versions/010_add_os_type_to_instances.py
+index a5b8058..49c09f8 100644
+--- a/nova/db/sqlalchemy/migrate_repo/versions/010_add_os_type_to_instances.py
++++ b/nova/db/sqlalchemy/migrate_repo/versions/010_add_os_type_to_instances.py
+@@ -19,7 +19,7 @@ from sqlalchemy import Column, Integer, MetaData, String, Table
+ meta = MetaData()
+ 
+ instances = Table('instances', meta,
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         )
+ 
+ instances_os_type = Column('os_type',
+diff --git a/nova/db/sqlalchemy/migrate_repo/versions/011_live_migration.py b/nova/db/sqlalchemy/migrate_repo/versions/011_live_migration.py
+index b2b0256..438fd16 100644
+--- a/nova/db/sqlalchemy/migrate_repo/versions/011_live_migration.py
++++ b/nova/db/sqlalchemy/migrate_repo/versions/011_live_migration.py
+@@ -23,7 +23,7 @@ from nova import log as logging
+ meta = MetaData()
+ 
+ instances = Table('instances', meta,
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         )
+ 
+ #
+@@ -35,7 +35,7 @@ compute_nodes = Table('compute_nodes', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('service_id', Integer(), nullable=False),
+ 
+         Column('vcpus', Integer(), nullable=False),
+diff --git a/nova/db/sqlalchemy/migrate_repo/versions/012_add_ipv6_flatmanager.py b/nova/db/sqlalchemy/migrate_repo/versions/012_add_ipv6_flatmanager.py
+index 10d2505..30ae74b 100644
+--- a/nova/db/sqlalchemy/migrate_repo/versions/012_add_ipv6_flatmanager.py
++++ b/nova/db/sqlalchemy/migrate_repo/versions/012_add_ipv6_flatmanager.py
+@@ -23,7 +23,7 @@ meta = MetaData()
+ # actual definitions of instances or services.
+ #
+ instances = Table('instances', meta,
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         )
+ 
+ #
+@@ -34,7 +34,7 @@ networks = Table('networks', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('injected', Boolean(create_constraint=True, name=None)),
+         Column('cidr',
+                String(length=255, convert_unicode=False, assert_unicode=None,
+@@ -89,7 +89,7 @@ fixed_ips = Table('fixed_ips', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('address',
+                String(length=255, convert_unicode=False, assert_unicode=None,
+                       unicode_error=None, _warn_on_bytestring=False)),
+diff --git a/nova/db/sqlalchemy/migrate_repo/versions/014_add_instance_type_id_to_instances.py b/nova/db/sqlalchemy/migrate_repo/versions/014_add_instance_type_id_to_instances.py
+index 62216be..e5e3773 100644
+--- a/nova/db/sqlalchemy/migrate_repo/versions/014_add_instance_type_id_to_instances.py
++++ b/nova/db/sqlalchemy/migrate_repo/versions/014_add_instance_type_id_to_instances.py
+@@ -32,7 +32,7 @@ c_instance_type_id = Column('instance_type_id',
+                            nullable=True)
+ 
+ instance_types = Table('instance_types', meta,
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('name',
+                String(length=255, convert_unicode=False, assert_unicode=None,
+                       unicode_error=None, _warn_on_bytestring=False),
+diff --git a/nova/db/sqlalchemy/migrate_repo/versions/019_add_volume_snapshot_support.py b/nova/db/sqlalchemy/migrate_repo/versions/019_add_volume_snapshot_support.py
+index f16d6db..c5cf715 100644
+--- a/nova/db/sqlalchemy/migrate_repo/versions/019_add_volume_snapshot_support.py
++++ b/nova/db/sqlalchemy/migrate_repo/versions/019_add_volume_snapshot_support.py
+@@ -27,7 +27,7 @@ snapshots = Table('snapshots', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('volume_id', Integer(), nullable=False),
+         Column('user_id',
+                String(length=255, convert_unicode=False, assert_unicode=None,
+diff --git a/nova/db/sqlalchemy/migrate_repo/versions/024_add_block_device_mapping.py b/nova/db/sqlalchemy/migrate_repo/versions/024_add_block_device_mapping.py
+index 6e9b806..b51cf80 100644
+--- a/nova/db/sqlalchemy/migrate_repo/versions/024_add_block_device_mapping.py
++++ b/nova/db/sqlalchemy/migrate_repo/versions/024_add_block_device_mapping.py
+@@ -27,11 +27,11 @@ instances = Table('instances', meta,
+         )
+ 
+ volumes = Table('volumes', meta,
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         )
+ 
+ snapshots = Table('snapshots', meta,
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         )
+ 
+ 
+diff --git a/nova/db/sqlalchemy/migrate_repo/versions/026_add_agent_table.py b/nova/db/sqlalchemy/migrate_repo/versions/026_add_agent_table.py
+index 640e961..7eab136 100644
+--- a/nova/db/sqlalchemy/migrate_repo/versions/026_add_agent_table.py
++++ b/nova/db/sqlalchemy/migrate_repo/versions/026_add_agent_table.py
+@@ -27,7 +27,7 @@ builds = Table('agent_builds', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('hypervisor',
+                String(length=255, convert_unicode=False, assert_unicode=None,
+                       unicode_error=None, _warn_on_bytestring=False)),
+diff --git a/nova/db/sqlalchemy/migrate_repo/versions/027_add_provider_firewall_rules.py b/nova/db/sqlalchemy/migrate_repo/versions/027_add_provider_firewall_rules.py
+index cb3c731..86475d6 100644
+--- a/nova/db/sqlalchemy/migrate_repo/versions/027_add_provider_firewall_rules.py
++++ b/nova/db/sqlalchemy/migrate_repo/versions/027_add_provider_firewall_rules.py
+@@ -28,17 +28,17 @@ meta = MetaData()
+ # Just for the ForeignKey and column creation to succeed, these are not the
+ # actual definitions of instances or services.
+ instances = Table('instances', meta,
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         )
+ 
+ 
+ services = Table('services', meta,
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         )
+ 
+ 
+ networks = Table('networks', meta,
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         )
+ 
+ 
+@@ -50,7 +50,7 @@ provider_fw_rules = Table('provider_fw_rules', meta,
+         Column('updated_at', DateTime(timezone=False)),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('protocol',
+                String(length=5, convert_unicode=False, assert_unicode=None,
+                       unicode_error=None, _warn_on_bytestring=False)),
+diff --git a/nova/db/sqlalchemy/migrate_repo/versions/029_add_zone_weight_offsets.py b/nova/db/sqlalchemy/migrate_repo/versions/029_add_zone_weight_offsets.py
+index 1b7871e..c2be4f4 100644
+--- a/nova/db/sqlalchemy/migrate_repo/versions/029_add_zone_weight_offsets.py
++++ b/nova/db/sqlalchemy/migrate_repo/versions/029_add_zone_weight_offsets.py
+@@ -17,7 +17,7 @@ from sqlalchemy import Column, Float, Integer, MetaData, Table
+ meta = MetaData()
+ 
+ zones = Table('zones', meta,
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         )
+ 
+ weight_offset = Column('weight_offset', Float(), default=0.0)
+diff --git a/nova/db/sqlalchemy/migrate_repo/versions/030_multi_nic.py b/nova/db/sqlalchemy/migrate_repo/versions/030_multi_nic.py
+index 4a117bb..7cb68b9 100644
+--- a/nova/db/sqlalchemy/migrate_repo/versions/030_multi_nic.py
++++ b/nova/db/sqlalchemy/migrate_repo/versions/030_multi_nic.py
+@@ -31,7 +31,7 @@ virtual_interfaces = Table('virtual_interfaces', meta,
+                onupdate=utils.utcnow()),
+         Column('deleted_at', DateTime(timezone=False)),
+         Column('deleted', Boolean(create_constraint=True, name=None)),
+-        Column('id', Integer(),  primary_key=True, nullable=False),
++        Column('id', Integer(), primary_key=True, nullable=False),
+         Column('address',
+                String(length=255, convert_unicode=False, assert_unicode=None,
+                       unicode_error=None, _warn_on_bytestring=False),
+diff --git a/nova/db/sqlalchemy/migrate_repo/versions/042_add_volume_types_and_extradata.py b/nova/db/sqlalchemy/migrate_repo/versions/042_add_volume_types_and_extradata.py
+index dd4cccb..a69ca75 100644
+--- a/nova/db/sqlalchemy/migrate_repo/versions/042_add_volume_types_and_extradata.py
++++ b/nova/db/sqlalchemy/migrate_repo/versions/042_add_volume_types_and_extradata.py
+@@ -27,7 +27,7 @@ meta = MetaData()
+ #
+ 
+ volumes = Table('volumes', meta,
+-       Column('id', Integer(),  primary_key=True, nullable=False),
++       Column('id', Integer(), primary_key=True, nullable=False),
+        )
+ 
+ volume_type_id = Column('volume_type_id', Integer(), nullable=True)
+diff --git a/nova/tests/api/openstack/test_flavors.py b/nova/tests/api/openstack/test_flavors.py
+index bd0a334..ff3155a 100644
+--- a/nova/tests/api/openstack/test_flavors.py
++++ b/nova/tests/api/openstack/test_flavors.py
+@@ -408,7 +408,8 @@ class FlavorsXMLSerializationTest(test.TestCase):
+                             "href": "http://localhost/fake/flavors/23",
+                         },
+                     ],
+-                },        {
++                },
++                {
+                     "id": "13",
+                     "name": "flavor 13",
+                     "ram": "256",
+@@ -492,7 +493,8 @@ class FlavorsXMLSerializationTest(test.TestCase):
+                             "href": "http://localhost/fake/flavors/23",
+                         },
+                     ],
+-                },        {
++                },
++                {
+                     "id": "13",
+                     "name": "flavor 13",
+                     "ram": "256",
+diff --git a/nova/tests/api/openstack/test_servers.py b/nova/tests/api/openstack/test_servers.py
+index f0a1c5c..821a02e 100644
+--- a/nova/tests/api/openstack/test_servers.py
++++ b/nova/tests/api/openstack/test_servers.py
+@@ -696,7 +696,7 @@ class ServersTest(test.TestCase):
+         self.assertEquals(ip.getAttribute('addr'), '1.2.3.4')
+         (private,) = server.getElementsByTagName('private')
+         (ip,) = private.getElementsByTagName('ip')
+-        self.assertEquals(ip.getAttribute('addr'),  '192.168.0.3')
++        self.assertEquals(ip.getAttribute('addr'), '192.168.0.3')
+ 
+     def test_get_server_by_id_with_addresses(self):
+         private = "192.168.0.3"
+diff --git a/nova/tests/scheduler/test_scheduler.py b/nova/tests/scheduler/test_scheduler.py
+index 8903481..8fe0748 100644
+--- a/nova/tests/scheduler/test_scheduler.py
++++ b/nova/tests/scheduler/test_scheduler.py
+@@ -1064,7 +1064,7 @@ class ZoneRedirectTest(test.TestCase):
+         self.assertEquals(decorator.get_collection_context_and_id(
+             (None, 10, 20), {}), ("servers", 10, 20))
+         self.assertEquals(decorator.get_collection_context_and_id(
+-            (None, 11,),  dict(instance_id=21)), ("servers", 11, 21))
++            (None, 11,), dict(instance_id=21)), ("servers", 11, 21))
+         self.assertEquals(decorator.get_collection_context_and_id(
+             (None,), dict(context=12, instance_id=22)), ("servers", 12, 22))
+ 
+diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py
+index 60da454..8d28590 100644
+--- a/nova/tests/test_libvirt.py
++++ b/nova/tests/test_libvirt.py
+@@ -200,14 +200,14 @@ class LibvirtConnTestCase(test.TestCase):
+         self.call_libvirt_dependant_setup = False
+         self.test_ip = '10.11.12.13'
+ 
+-    test_instance = {'memory_kb':     '1024000',
+-                     'basepath':      '/some/path',
+-                     'bridge_name':   'br100',
+-                     'vcpus':         2,
+-                     'project_id':    'fake',
+-                     'bridge':        'br101',
+-                     'image_ref':     '123456',
+-                     'local_gb':      20,
++    test_instance = {'memory_kb': '1024000',
++                     'basepath': '/some/path',
++                     'bridge_name': 'br100',
++                     'vcpus': 2,
++                     'project_id': 'fake',
++                     'bridge': 'br101',
++                     'image_ref': '123456',
++                     'local_gb': 20,
+                      'instance_type_id': '5'}  # m1.small
+ 
+     def lazy_load_library_exists(self):
+diff --git a/nova/tests/test_network.py b/nova/tests/test_network.py
+index 9c28c86..844aba2 100644
+--- a/nova/tests/test_network.py
++++ b/nova/tests/test_network.py
+@@ -503,7 +503,7 @@ class CommonNetworkTestCase(test.TestCase):
+ 
+         class FakeDB:
+             def fixed_ip_get_by_instance(self, context, instance_id):
+-                return [dict(address='10.0.0.0'),  dict(address='10.0.0.1'),
++                return [dict(address='10.0.0.0'), dict(address='10.0.0.1'),
+                         dict(address='10.0.0.2')]
+ 
+             def network_get_by_cidr(self, context, cidr):
+diff --git a/run_tests.sh b/run_tests.sh
+index c1fda4c..b2567fe 100755
+--- a/run_tests.sh
++++ b/run_tests.sh
+@@ -13,6 +13,7 @@ function usage {
+   echo "  -x, --stop               Stop running tests after the first error or failure."
+   echo "  -f, --force              Force a clean re-build of the virtual environment. Useful when dependencies have been added."
+   echo "  -p, --pep8               Just run pep8"
++  echo "  -P, --no-pep8            Don't run pep8"
+   echo "  -c, --coverage           Generate coverage report"
+   echo "  -h, --help               Print this usage message"
+   echo "  --hide-elapsed           Don't print the elapsed time for each test along with slow test list"
+@@ -32,6 +33,7 @@ function process_option {
+     -n|--no-recreate-db) recreate_db=0;;
+     -f|--force) force=1;;
+     -p|--pep8) just_pep8=1;;
++    -P|--no-pep8) no_pep8=1;;
+     -c|--coverage) coverage=1;;
+     -*) noseopts="$noseopts $1";;
+     *) noseargs="$noseargs $1"
+@@ -47,6 +49,7 @@ noseargs=
+ noseopts=
+ wrapper=""
+ just_pep8=0
++no_pep8=0
+ coverage=0
+ recreate_db=1
+ 
+@@ -87,7 +90,8 @@ function run_pep8 {
+   srcfiles+=" nova setup.py plugins/xenserver/xenapi/etc/xapi.d/plugins/glance"
+   # Just run PEP8 in current environment
+   ${wrapper} pep8 --repeat --show-pep8 --show-source \
+-  --exclude=vcsversion.py ${srcfiles}
++    --ignore=E202 \
++    --exclude=vcsversion.py ${srcfiles}
+ }
+ 
+ NOSETESTS="python run_tests.py $noseopts $noseargs"
+@@ -139,7 +143,9 @@ run_tests
+ # distinguish between options (noseopts), which begin with a '-', and
+ # arguments (noseargs).
+ if [ -z "$noseargs" ]; then
+-  run_pep8
++  if [ $no_pep8 -eq 0 ]; then
++    run_pep8
++  fi
+ fi
+ 
+ if [ $coverage -eq 1 ]; then
+-- 
+1.7.6.4
+
diff --git a/0006-Point-tools-rfc.sh-at-the-right-branch.patch b/0006-Point-tools-rfc.sh-at-the-right-branch.patch
new file mode 100644
index 0000000..9228f58
--- /dev/null
+++ b/0006-Point-tools-rfc.sh-at-the-right-branch.patch
@@ -0,0 +1,26 @@
+From 2e8b1175e43cce67832e2c564598e6cf2efff2de Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Tue, 18 Oct 2011 21:33:07 +0100
+Subject: [PATCH 06/40] Point tools/rfc.sh at the right branch
+
+Change-Id: I9c4ed40015ea658530206c3c0d0aad70605cd5fe
+---
+ tools/rfc.sh |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/tools/rfc.sh b/tools/rfc.sh
+index 0c578f1..1afc13b 100755
+--- a/tools/rfc.sh
++++ b/tools/rfc.sh
+@@ -20,7 +20,7 @@
+ # <http://www.gnu.org/licenses/>.
+ 
+ 
+-branch="master";
++branch="stable/diablo";
+ 
+ set_hooks_commit_msg()
+ {
+-- 
+1.7.6.4
+
diff --git a/0002-Makes-sure-to-recreate-gateway-for-moved-ip.patch b/0007-Makes-sure-to-recreate-gateway-for-moved-ip.patch
similarity index 95%
rename from 0002-Makes-sure-to-recreate-gateway-for-moved-ip.patch
rename to 0007-Makes-sure-to-recreate-gateway-for-moved-ip.patch
index 183728a..36e6e31 100644
--- a/0002-Makes-sure-to-recreate-gateway-for-moved-ip.patch
+++ b/0007-Makes-sure-to-recreate-gateway-for-moved-ip.patch
@@ -1,13 +1,14 @@
-From 96f0a932c59f03275a438d23386db5686b7f58e7 Mon Sep 17 00:00:00 2001
+From 1c8fedc82c4b388b0a3a876a54c7f14d3c2a8342 Mon Sep 17 00:00:00 2001
 From: Vishvananda Ishaya <vishvananda at gmail.com>
 Date: Mon, 26 Sep 2011 05:14:39 -0700
-Subject: [PATCH] Makes sure to recreate gateway for moved ip
+Subject: [PATCH 07/40] Makes sure to recreate gateway for moved ip
 
 If nova moves an ip when setting up dhcp, make sure to reset
 the default gateway.  Fixes bug 859587
 
-Change-Id: I9f2b7bc5ede142717df6cb1653043b4f5c09959a
 (cherry picked from commit 569b310b003c1c96151a3e3d448ddf5fe4e9299a)
+
+Change-Id: I6dd1fb9d80c9635a8a721e77386938684cdd8f53
 ---
  nova/network/linux_net.py    |   13 +++++++++++++
  nova/tests/test_linux_net.py |   32 +++++++++++++++++++++++++++++++-
diff --git a/0008-put-fully-qualified-domain-name-in-local-hostname.patch b/0008-put-fully-qualified-domain-name-in-local-hostname.patch
new file mode 100644
index 0000000..6932995
--- /dev/null
+++ b/0008-put-fully-qualified-domain-name-in-local-hostname.patch
@@ -0,0 +1,103 @@
+From 44a2a648e7c26e3721e5ee6e28a0104458bceba3 Mon Sep 17 00:00:00 2001
+From: Scott Moser <smoser at ubuntu.com>
+Date: Fri, 23 Sep 2011 16:44:44 -0400
+Subject: [PATCH 08/40] put fully qualified domain name in local-hostname
+
+make metadata service return fully qualified domain name (fqdn) in
+the local-hostname field. (bug 854614)
+
+Also, move the dhcp_domain flag from being in nova.network.linux_net to be
+in the more common nova.network.manager.  Since it is being used for
+something more generic, it shouldnt be stuck in linux_net.
+
+(cherry picked from commit 6415999523d26f1680265e5ca438020b7d6542c6)
+
+Change-Id: I1cc9266ad197f603bb434d77d944e10a6f4e91ba
+---
+ nova/api/ec2/cloud.py       |    3 ++-
+ nova/network/linux_net.py   |    3 ---
+ nova/network/manager.py     |    3 +++
+ nova/tests/test_metadata.py |    8 ++++++++
+ 4 files changed, 13 insertions(+), 4 deletions(-)
+
+diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
+index d309a70..b9fc7a0 100644
+--- a/nova/api/ec2/cloud.py
++++ b/nova/api/ec2/cloud.py
+@@ -52,6 +52,7 @@ from nova.image import s3
+ 
+ 
+ FLAGS = flags.FLAGS
++flags.DECLARE('dhcp_domain', 'nova.network.manager')
+ flags.DECLARE('service_down_time', 'nova.scheduler.driver')
+ 
+ LOG = logging.getLogger("nova.api.cloud")
+@@ -326,7 +327,7 @@ class CloudController(object):
+         instance_ref = db.instance_get(ctxt, instance_ref[0]['id'])
+ 
+         mpi = self._get_mpi_data(ctxt, instance_ref['project_id'])
+-        hostname = instance_ref['hostname']
++        hostname = "%s.%s" % (instance_ref['hostname'], FLAGS.dhcp_domain)
+         host = instance_ref['host']
+         availability_zone = self._get_availability_zone_by_host(ctxt, host)
+         floating_ip = db.instance_get_floating_address(ctxt,
+diff --git a/nova/network/linux_net.py b/nova/network/linux_net.py
+index ac52c16..5370f37 100755
+--- a/nova/network/linux_net.py
++++ b/nova/network/linux_net.py
+@@ -42,9 +42,6 @@ FLAGS = flags.FLAGS
+ flags.DEFINE_string('dhcpbridge_flagfile',
+                     '/etc/nova/nova-dhcpbridge.conf',
+                     'location of flagfile for dhcpbridge')
+-flags.DEFINE_string('dhcp_domain',
+-                    'novalocal',
+-                    'domain to use for building the hostnames')
+ flags.DEFINE_string('networks_path', '$state_path/networks',
+                     'Location to keep network config files')
+ flags.DEFINE_string('public_interface', 'eth0',
+diff --git a/nova/network/manager.py b/nova/network/manager.py
+index 5c2bc60..c582d4d 100644
+--- a/nova/network/manager.py
++++ b/nova/network/manager.py
+@@ -112,6 +112,9 @@ flags.DEFINE_bool('fake_call', False,
+                   'If True, skip using the queue and make local calls')
+ flags.DEFINE_bool('force_dhcp_release', False,
+                   'If True, send a dhcp release on instance termination')
++flags.DEFINE_string('dhcp_domain',
++                    'novalocal',
++                    'domain to use for building the hostnames')
+ 
+ 
+ class AddressAlreadyAllocated(exception.Error):
+diff --git a/nova/tests/test_metadata.py b/nova/tests/test_metadata.py
+index b06e5c1..f898609 100644
+--- a/nova/tests/test_metadata.py
++++ b/nova/tests/test_metadata.py
+@@ -24,12 +24,16 @@ import httplib
+ import webob
+ 
+ from nova import exception
++from nova import flags
+ from nova import test
+ from nova import wsgi
+ from nova.api.ec2 import metadatarequesthandler
+ from nova.db.sqlalchemy import api
+ 
+ 
++FLAGS = flags.FLAGS
++flags.DECLARE('dhcp_domain', 'nova.network.manager')
++
+ USER_DATA_STRING = ("This is an encoded string")
+ ENCODE_USER_DATA_STRING = base64.b64encode(USER_DATA_STRING)
+ 
+@@ -119,3 +123,7 @@ class MetadataTestCase(test.TestCase):
+         response = request.get_response(self.app)
+         self.assertEqual(response.status_int, 200)
+         self.assertEqual(response.body, USER_DATA_STRING)
++
++    def test_local_hostname_fqdn(self):
++        self.assertEqual(self.request('/meta-data/local-hostname'),
++            "%s.%s" % (self.instance['hostname'], FLAGS.dhcp_domain))
+-- 
+1.7.6.4
+
diff --git a/0003-Fix-the-grantee-group-loading-for-source-groups.patch b/0009-Fix-the-grantee-group-loading-for-source-groups.patch
similarity index 83%
rename from 0003-Fix-the-grantee-group-loading-for-source-groups.patch
rename to 0009-Fix-the-grantee-group-loading-for-source-groups.patch
index 0015185..ccec3db 100644
--- a/0003-Fix-the-grantee-group-loading-for-source-groups.patch
+++ b/0009-Fix-the-grantee-group-loading-for-source-groups.patch
@@ -1,11 +1,13 @@
-From f558a865a4b3d67a6d1e33b888de79daf5ff2021 Mon Sep 17 00:00:00 2001
+From 1f6b213d92e71de1eb669e9fb869d564066dadf5 Mon Sep 17 00:00:00 2001
 From: Vishvananda Ishaya <vishvananda at gmail.com>
 Date: Mon, 26 Sep 2011 08:34:14 -0700
-Subject: [PATCH] Fix the grantee group loading for source groups
+Subject: [PATCH 09/40] Fix the grantee group loading for source groups
 
 Fixes bug 859679.
 
-Change-Id: Ia0b90b8373a02955f23b6dda0495f01511762822
+(cherry picked from commit 114ca0b2dc090270d8d20bd10b6e1e7a0b451db2)
+
+Change-Id: I92569ecc50fe3e9f17f633df03ee428587749a48
 ---
  nova/db/sqlalchemy/api.py |    5 ++---
  1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/0010-Call-endheaders-when-auth_token-is-None.-Fixes-bug-8.patch b/0010-Call-endheaders-when-auth_token-is-None.-Fixes-bug-8.patch
new file mode 100644
index 0000000..d1dceaa
--- /dev/null
+++ b/0010-Call-endheaders-when-auth_token-is-None.-Fixes-bug-8.patch
@@ -0,0 +1,29 @@
+From 2754749c3767b7ddd90957b528828e235e25ccab Mon Sep 17 00:00:00 2001
+From: Dan Prince <dan.prince at rackspace.com>
+Date: Mon, 26 Sep 2011 13:39:14 -0400
+Subject: [PATCH 10/40] Call endheaders when auth_token is None. Fixes bug
+ 856721.
+
+(cherry picked from commit 14eb9c6ec9c82c9f56cde5279aebb1e5a8fac4f4)
+
+Change-Id: I39965c311d8485a87e27e83605ee52c6b1386c71
+---
+ plugins/xenserver/xenapi/etc/xapi.d/plugins/glance |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
+index 1a9ac37..3f12c2e 100755
+--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
++++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
+@@ -255,7 +255,7 @@ def _upload_tarball(staging_path, image_id, glance_host, glance_port, os_type,
+     conn.putrequest('HEAD', '/v1/images/%s' % image_id)
+     if auth_token:
+         conn.putheader('x-auth-token', auth_token)
+-        conn.endheaders()
++    conn.endheaders()
+ 
+     resp = conn.getresponse()
+     if resp.status != httplib.OK:
+-- 
+1.7.6.4
+
diff --git a/0001-Removed-db_pool-complexities-from-nova.db.sqlalchemy.patch b/0011-Removed-db_pool-complexities-from-nova.db.sqlalchemy.patch
similarity index 94%
rename from 0001-Removed-db_pool-complexities-from-nova.db.sqlalchemy.patch
rename to 0011-Removed-db_pool-complexities-from-nova.db.sqlalchemy.patch
index 2a6bc2c..03838bc 100644
--- a/0001-Removed-db_pool-complexities-from-nova.db.sqlalchemy.patch
+++ b/0011-Removed-db_pool-complexities-from-nova.db.sqlalchemy.patch
@@ -1,11 +1,12 @@
-From a122333e8faa77b57214071e6b2a45fb9eb986e0 Mon Sep 17 00:00:00 2001
+From 1a5e3e0c4cc2a3bf55331d46f702b980af1fbf97 Mon Sep 17 00:00:00 2001
 From: Brian Lamar <brian.lamar at rackspace.com>
 Date: Mon, 26 Sep 2011 11:52:21 -0400
-Subject: [PATCH] Removed db_pool complexities from
+Subject: [PATCH 11/40] Removed db_pool complexities from
  nova.db.sqlalchemy.session. Fixes bug 838581.
 
-Change-Id: I9b1f4790fcdb890a5113b853f1b1483f3212c530
 (cherry picked from commit f3dd56e916232e38e74d9e2f24ce9a738cac63cf)
+
+Change-Id: I96442f9c9eeddc48ce8307da93ff289e3d679553
 ---
  nova/db/sqlalchemy/session.py |   34 +---------------------------------
  nova/flags.py                 |    6 ------
diff --git a/0012-Raise-InsufficientFreeMemory.patch b/0012-Raise-InsufficientFreeMemory.patch
new file mode 100644
index 0000000..e6a8af9
--- /dev/null
+++ b/0012-Raise-InsufficientFreeMemory.patch
@@ -0,0 +1,69 @@
+From 410a8df435fb424105872dc0a39f68eed902fbf2 Mon Sep 17 00:00:00 2001
+From: Aaron Lee <aaron.lee at rackspace.com>
+Date: Mon, 26 Sep 2011 18:22:03 -0500
+Subject: [PATCH 12/40] Raise InsufficientFreeMemory
+
+Kind of fixes bug 851374 & bug 858679
+
+Raises InsufficientFreeMemory if an instance can't
+start because of that. This will cause the normal
+instance failure recovery to catch this problem,
+set the state, and log the error. This also
+removes instance_set_state from db/api.py as that
+was causing these exceptions in the first place.
+
+(cherry picked from commit 7dba1d9aa989760b190f1cf3bad2ed22bb2e2fc5)
+
+Change-Id: I93d4e3e2c264f520c0cd37c778a0db42eeb8345d
+---
+ nova/exception.py         |    4 ++++
+ nova/tests/test_xenapi.py |    2 +-
+ nova/virt/xenapi/vmops.py |    7 +------
+ 3 files changed, 6 insertions(+), 7 deletions(-)
+
+diff --git a/nova/exception.py b/nova/exception.py
+index 4f25d37..ba67f09 100644
+--- a/nova/exception.py
++++ b/nova/exception.py
+@@ -817,3 +817,7 @@ class ZoneRequestError(Error):
+         if message is None:
+             message = _("1 or more Zones could not complete the request")
+         super(ZoneRequestError, self).__init__(message=message)
++
++
++class InsufficientFreeMemory(NovaException):
++    message = _("Insufficient free memory on compute node to start %(uuid)s.")
+diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py
+index 47c6a3c..e4fde88 100644
+--- a/nova/tests/test_xenapi.py
++++ b/nova/tests/test_xenapi.py
+@@ -413,7 +413,7 @@ class XenAPIVMTestCase(test.TestCase):
+         self.check_vm_params_for_linux()
+ 
+     def test_spawn_not_enough_memory(self):
+-        self.assertRaises(Exception,
++        self.assertRaises(exception.InsufficientFreeMemory,
+                           self._test_spawn,
+                           1, 2, 3, "4")  # m1.xlarge
+ 
+diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
+index b0833f1..f483758 100644
+--- a/nova/virt/xenapi/vmops.py
++++ b/nova/virt/xenapi/vmops.py
+@@ -169,12 +169,7 @@ class VMOps(object):
+ 
+         #ensure enough free memory is available
+         if not VMHelper.ensure_free_mem(self._session, instance):
+-            LOG.exception(_('instance %(instance_name)s: not enough free '
+-                          'memory') % locals())
+-            db.instance_set_state(nova_context.get_admin_context(),
+-                                  instance['id'],
+-                                  power_state.SHUTDOWN)
+-            return
++            raise exception.InsufficientFreeMemory(uuid=instance.uuid)
+ 
+         disk_image_type = VMHelper.determine_disk_image_type(instance, context)
+         kernel = None
+-- 
+1.7.6.4
+
diff --git a/0013-Don-t-leak-exceptions-out-to-users.patch b/0013-Don-t-leak-exceptions-out-to-users.patch
new file mode 100644
index 0000000..d720346
--- /dev/null
+++ b/0013-Don-t-leak-exceptions-out-to-users.patch
@@ -0,0 +1,36 @@
+From 03c9f40f1d7be54e62b129edf41a3c729049ce0c Mon Sep 17 00:00:00 2001
+From: Johannes Erdfelt <johannes.erdfelt at rackspace.com>
+Date: Tue, 18 Oct 2011 22:08:49 +0000
+Subject: [PATCH 13/40] Don't leak exceptions out to users
+
+Fixed bug 874472
+
+Exceptions can contain all kinds of sensitive information, including
+SQL queries (and arguments), configuration information and in some
+cases the correct password (bug 868360). The information isn't useful
+to users, so don't return potentially sensitive information. The
+exceptions still get logged for debugging and troubleshooting purposes.
+
+(cherry picked from commit 2431b7848d633dc67ad684b4d1cc79468df24568)
+
+Change-Id: I45af83ee5276b92259522a4761137d7339d2b77d
+---
+ nova/api/openstack/__init__.py |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/nova/api/openstack/__init__.py b/nova/api/openstack/__init__.py
+index 3b74fef..36da46b 100644
+--- a/nova/api/openstack/__init__.py
++++ b/nova/api/openstack/__init__.py
+@@ -64,7 +64,7 @@ class FaultWrapper(base_wsgi.Middleware):
+             return req.get_response(self.application)
+         except Exception as ex:
+             LOG.exception(_("Caught error: %s"), unicode(ex))
+-            exc = webob.exc.HTTPInternalServerError(explanation=unicode(ex))
++            exc = webob.exc.HTTPInternalServerError()
+             return faults.Fault(exc)
+ 
+ 
+-- 
+1.7.6.4
+
diff --git a/0014-Makes-snapshots-work-for-amis.-Fixes-bug-873156.patch b/0014-Makes-snapshots-work-for-amis.-Fixes-bug-873156.patch
new file mode 100644
index 0000000..790fa88
--- /dev/null
+++ b/0014-Makes-snapshots-work-for-amis.-Fixes-bug-873156.patch
@@ -0,0 +1,166 @@
+From d46f6e095b43fc00099d87f73b098a137830b167 Mon Sep 17 00:00:00 2001
+From: Vishvananda Ishaya <vishvananda at gmail.com>
+Date: Fri, 14 Oct 2011 10:06:00 -0700
+Subject: [PATCH 14/40] Makes snapshots work for amis. Fixes bug 873156
+
+(cherry picked from commit b931d51ce47203ee6a4433dc7577e0779ab94710)
+
+Change-Id: I3adee5aed8a500602fb938f27fa5096ec376cbe2
+---
+ nova/image/fake.py              |   20 +++++++++---------
+ nova/tests/test_image.py        |    3 +-
+ nova/tests/test_libvirt.py      |   41 +++++++++++++++++++++++++++++++++++++++
+ nova/virt/libvirt/connection.py |    9 +++++++-
+ 4 files changed, 61 insertions(+), 12 deletions(-)
+
+diff --git a/nova/image/fake.py b/nova/image/fake.py
+index 97af817..2897bee 100644
+--- a/nova/image/fake.py
++++ b/nova/image/fake.py
+@@ -49,8 +49,8 @@ class _FakeImageService(service.BaseImageService):
+                  'deleted': False,
+                  'status': 'active',
+                  'is_public': False,
+-#                 'container_format': 'ami',
+-#                 'disk_format': 'raw',
++                 'container_format': 'raw',
++                 'disk_format': 'raw',
+                  'properties': {'kernel_id': FLAGS.null_kernel,
+                                 'ramdisk_id': FLAGS.null_kernel,
+                                 'architecture': 'x86_64'}}
+@@ -63,8 +63,8 @@ class _FakeImageService(service.BaseImageService):
+                  'deleted': False,
+                  'status': 'active',
+                  'is_public': True,
+-#                 'container_format': 'ami',
+-#                 'disk_format': 'raw',
++                 'container_format': 'ami',
++                 'disk_format': 'ami',
+                  'properties': {'kernel_id': FLAGS.null_kernel,
+                                 'ramdisk_id': FLAGS.null_kernel}}
+ 
+@@ -76,8 +76,8 @@ class _FakeImageService(service.BaseImageService):
+                  'deleted': False,
+                  'status': 'active',
+                  'is_public': True,
+-#                 'container_format': 'ami',
+-#                 'disk_format': 'raw',
++                 'container_format': None,
++                 'disk_format': None,
+                  'properties': {'kernel_id': FLAGS.null_kernel,
+                                 'ramdisk_id': FLAGS.null_kernel}}
+ 
+@@ -89,8 +89,8 @@ class _FakeImageService(service.BaseImageService):
+                  'deleted': False,
+                  'status': 'active',
+                  'is_public': True,
+-#                 'container_format': 'ami',
+-#                 'disk_format': 'raw',
++                 'container_format': 'ami',
++                 'disk_format': 'ami',
+                  'properties': {'kernel_id': FLAGS.null_kernel,
+                                 'ramdisk_id': FLAGS.null_kernel}}
+ 
+@@ -102,8 +102,8 @@ class _FakeImageService(service.BaseImageService):
+                  'deleted': False,
+                  'status': 'active',
+                  'is_public': True,
+-#                 'container_format': 'ami',
+-#                 'disk_format': 'raw',
++                 'container_format': 'ami',
++                 'disk_format': 'ami',
+                  'properties': {'kernel_id': FLAGS.null_kernel,
+                                 'ramdisk_id': FLAGS.null_kernel}}
+ 
+diff --git a/nova/tests/test_image.py b/nova/tests/test_image.py
+index 9680d6f..9eeefe0 100644
+--- a/nova/tests/test_image.py
++++ b/nova/tests/test_image.py
+@@ -39,7 +39,8 @@ class _ImageTestCase(test.TestCase):
+             keys = set(image.keys())
+             self.assertEquals(keys, set(['id', 'name', 'created_at',
+                                          'updated_at', 'deleted_at', 'deleted',
+-                                         'status', 'is_public', 'properties']))
++                                         'status', 'is_public', 'properties',
++                                         'disk_format', 'container_format']))
+             self.assertTrue(isinstance(image['created_at'], datetime.datetime))
+             self.assertTrue(isinstance(image['updated_at'], datetime.datetime))
+ 
+diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py
+index 8d28590..51e584d 100644
+--- a/nova/tests/test_libvirt.py
++++ b/nova/tests/test_libvirt.py
+@@ -340,6 +340,47 @@ class LibvirtConnTestCase(test.TestCase):
+         instance_data = dict(self.test_instance)
+         self._check_xml_and_container(instance_data)
+ 
++    def test_snapshot_in_ami_format(self):
++        if not self.lazy_load_library_exists():
++            return
++
++        self.flags(image_service='nova.image.fake.FakeImageService')
++
++        # Start test
++        image_service = utils.import_object(FLAGS.image_service)
++
++        # Assign image_ref = 3 from nova/images/fakes for testing
++        # ami image
++        test_instance = copy.deepcopy(self.test_instance)
++        test_instance["image_ref"] = "3"
++
++        # Assuming that base image already exists in image_service
++        instance_ref = db.instance_create(self.context, test_instance)
++        properties = {'instance_id': instance_ref['id'],
++                      'user_id': str(self.context.user_id)}
++        snapshot_name = 'test-snap'
++        sent_meta = {'name': snapshot_name, 'is_public': False,
++                     'status': 'creating', 'properties': properties}
++        # Create new image. It will be updated in snapshot method
++        # To work with it from snapshot, the single image_service is needed
++        recv_meta = image_service.create(context, sent_meta)
++
++        self.mox.StubOutWithMock(connection.LibvirtConnection, '_conn')
++        connection.LibvirtConnection._conn.lookupByName = self.fake_lookup
++        self.mox.StubOutWithMock(connection.utils, 'execute')
++        connection.utils.execute = self.fake_execute
++
++        self.mox.ReplayAll()
++
++        conn = connection.LibvirtConnection(False)
++        conn.snapshot(self.context, instance_ref, recv_meta['id'])
++
++        snapshot = image_service.show(context, recv_meta['id'])
++        self.assertEquals(snapshot['properties']['image_state'], 'available')
++        self.assertEquals(snapshot['status'], 'active')
++        self.assertEquals(snapshot['disk_format'], 'ami')
++        self.assertEquals(snapshot['name'], snapshot_name)
++
+     def test_snapshot_in_raw_format(self):
+         if not self.lazy_load_library_exists():
+             return
+diff --git a/nova/virt/libvirt/connection.py b/nova/virt/libvirt/connection.py
+index 9290c5e..4b45515 100644
+--- a/nova/virt/libvirt/connection.py
++++ b/nova/virt/libvirt/connection.py
+@@ -420,10 +420,17 @@ class LibvirtConnection(driver.ComputeDriver):
+             metadata['properties']['architecture'] = arch
+ 
+         source_format = base.get('disk_format') or 'raw'
++        if source_format == 'ami':
++            # NOTE(vish): assume amis are raw
++            source_format = 'raw'
+         image_format = FLAGS.snapshot_image_format or source_format
+         if FLAGS.use_cow_images:
+             source_format = 'qcow2'
+-        metadata['disk_format'] = image_format
++        # NOTE(vish): glance forces ami disk format to be ami
++        if base.get('disk_format') == 'ami':
++            metadata['disk_format'] = 'ami'
++        else:
++            metadata['disk_format'] = image_format
+ 
+         if 'container_format' in base:
+             metadata['container_format'] = base['container_format']
+-- 
+1.7.6.4
+
diff --git a/0015-Add-missing-author.patch b/0015-Add-missing-author.patch
new file mode 100644
index 0000000..e4d3600
--- /dev/null
+++ b/0015-Add-missing-author.patch
@@ -0,0 +1,25 @@
+From 26434ef46761b6e1303f394c32031057b7fec4fd Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Tue, 25 Oct 2011 06:19:27 +0100
+Subject: [PATCH 15/40] Add missing author
+
+Add Aaron Lee to Authors for the previous patch which somehow got
+past Jenkins.
+
+Change-Id: I671685f261f687bb4f9e3c39db25c57115927b69
+---
+ Authors |    1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/Authors b/Authors
+index 8d6837e..f3962c8 100644
+--- a/Authors
++++ b/Authors
+@@ -1,3 +1,4 @@
++Aaron Lee <aaron.lee at rackspace.com>
+ Adam Gandelman <adamg at canonical.com>
+ Adam Johnson <adjohn at gmail.com>
+ Alex Meade <alex.meade at rackspace.com>
+-- 
+1.7.6.4
+
diff --git a/0016-Make-snapshots-private-by-default.patch b/0016-Make-snapshots-private-by-default.patch
new file mode 100644
index 0000000..f4bd133
--- /dev/null
+++ b/0016-Make-snapshots-private-by-default.patch
@@ -0,0 +1,30 @@
+From 5d4b9111caa80258d1aff4b68d9524915d711838 Mon Sep 17 00:00:00 2001
+From: Johannes Erdfelt <johannes.erdfelt at rackspace.com>
+Date: Wed, 28 Sep 2011 02:53:58 +0000
+Subject: [PATCH 16/40] Make snapshots private by default
+
+Fixes bug 850389
+
+(cherry picked from commit 6574d1bb17ad111e5dd5b1c7b2e6f0a698e2c275)
+
+Change-Id: I10101c0edb70c70db7a3b27ee4b8cc8f2f62a503
+---
+ plugins/xenserver/xenapi/etc/xapi.d/plugins/glance |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
+index 3f12c2e..4302c84 100755
+--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
++++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
+@@ -283,7 +283,7 @@ def _upload_tarball(staging_path, image_id, glance_host, glance_port, os_type,
+     ovf_headers = {
+         'content-type': 'application/octet-stream',
+         'transfer-encoding': 'chunked',
+-        'x-image-meta-is-public': 'True',
++        'x-image-meta-is-public': 'False',
+         'x-image-meta-status': 'queued',
+         'x-image-meta-disk-format': 'vhd',
+         'x-image-meta-container-format': 'ovf',
+-- 
+1.7.6.4
+
diff --git a/0017-Snapshots-backups-can-no-longer-happen-simultaneousl.patch b/0017-Snapshots-backups-can-no-longer-happen-simultaneousl.patch
new file mode 100644
index 0000000..0ab2c62
--- /dev/null
+++ b/0017-Snapshots-backups-can-no-longer-happen-simultaneousl.patch
@@ -0,0 +1,196 @@
+From 852b9307ac86b20cbe870aa5bbfaf121226f5440 Mon Sep 17 00:00:00 2001
+From: Brian Lamar <brian.lamar at rackspace.com>
+Date: Mon, 26 Sep 2011 23:41:28 -0400
+Subject: [PATCH 17/40] Snapshots/backups can no longer happen simultaneously.
+ Tests included.
+
+Implemented exception.InstanceBusy when attempting to snapshot/backup an
+instance which is already snapshotting or being currently backed up.
+
+Fixes bug 727502.
+
+(Patch Set 2) 3 new exceptions: InstanceBusy, InstanceSnapshotting, and InstanceBackingUp
+(Patch Set 3) Oops. New exceptions now inherit from InstanceBusy
+(Patch Set 4) Tests now tear down created instances
+
+(cherry picked from commit b5abd8e7415c28630852107da7755045f6522b50)
+
+Change-Id: I42a04254bd96d5f7a92b71a5d3e79f0350bbda5b
+---
+ nova/api/openstack/images.py             |   13 ++++++++---
+ nova/api/openstack/servers.py            |   12 +++++++---
+ nova/compute/api.py                      |    8 +++++++
+ nova/exception.py                        |   12 +++++++++++
+ nova/tests/api/openstack/test_servers.py |   17 ++++++++++++++++
+ nova/tests/test_compute.py               |   31 ++++++++++++++++++++++++++++++
+ 6 files changed, 85 insertions(+), 8 deletions(-)
+
+diff --git a/nova/api/openstack/images.py b/nova/api/openstack/images.py
+index 1c8fc10..b6dfa22 100644
+--- a/nova/api/openstack/images.py
++++ b/nova/api/openstack/images.py
+@@ -124,10 +124,15 @@ class ControllerV10(Controller):
+ 
+         context = req.environ["nova.context"]
+         props = {'instance_id': instance_id}
+-        image = self._compute_service.snapshot(context,
+-                                          instance_id,
+-                                          image_name,
+-                                          extra_properties=props)
++
++        try:
++            image = self._compute_service.snapshot(context,
++                                              instance_id,
++                                              image_name,
++                                              extra_properties=props)
++        except exception.InstanceBusy:
++            msg = _("Server is currently creating an image. Please wait.")
++            raise webob.exc.HTTPConflict(explanation=msg)
+ 
+         return dict(image=self.get_builder(req).build(image, detail=True))
+ 
+diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
+index d084ac3..94c4e99 100644
+--- a/nova/api/openstack/servers.py
++++ b/nova/api/openstack/servers.py
+@@ -811,10 +811,14 @@ class ControllerV11(Controller):
+             msg = _("Invalid metadata")
+             raise webob.exc.HTTPBadRequest(explanation=msg)
+ 
+-        image = self.compute_api.snapshot(context,
+-                                          instance_id,
+-                                          image_name,
+-                                          extra_properties=props)
++        try:
++            image = self.compute_api.snapshot(context,
++                                              instance_id,
++                                              image_name,
++                                              extra_properties=props)
++        except exception.InstanceBusy:
++            msg = _("Server is currently creating an image. Please wait.")
++            raise webob.exc.HTTPConflict(explanation=msg)
+ 
+         # build location of newly-created image entity
+         image_id = str(image['id'])
+diff --git a/nova/compute/api.py b/nova/compute/api.py
+index 96d5fed..0d6e16d 100644
+--- a/nova/compute/api.py
++++ b/nova/compute/api.py
+@@ -1028,6 +1028,14 @@ class API(base.Base):
+ 
+         """
+         instance = self.db.instance_get(context, instance_id)
++        task_state = instance["task_state"]
++
++        if task_state == task_states.IMAGE_BACKUP:
++            raise exception.InstanceBackingUp(instance_id=instance_id)
++
++        if task_state == task_states.IMAGE_SNAPSHOT:
++            raise exception.InstanceSnapshotting(instance_id=instance_id)
++
+         properties = {'instance_uuid': instance['uuid'],
+                       'user_id': str(context.user_id),
+                       'image_state': 'creating',
+diff --git a/nova/exception.py b/nova/exception.py
+index ba67f09..79b1bf3 100644
+--- a/nova/exception.py
++++ b/nova/exception.py
+@@ -182,6 +182,18 @@ class AdminRequired(NotAuthorized):
+     message = _("User does not have admin privileges")
+ 
+ 
++class InstanceBusy(NovaException):
++    message = _("Instance %(instance_id)s is busy. (%(task_state)s)")
++
++
++class InstanceSnapshotting(InstanceBusy):
++    message = _("Instance %(instance_id)s is currently snapshotting.")
++
++
++class InstanceBackingUp(InstanceBusy):
++    message = _("Instance %(instance_id)s is currently being backed up.")
++
++
+ class Invalid(NovaException):
+     message = _("Unacceptable parameters.")
+ 
+diff --git a/nova/tests/api/openstack/test_servers.py b/nova/tests/api/openstack/test_servers.py
+index 821a02e..817b8a3 100644
+--- a/nova/tests/api/openstack/test_servers.py
++++ b/nova/tests/api/openstack/test_servers.py
+@@ -1626,6 +1626,23 @@ class ServersTest(test.TestCase):
+         res = req.get_response(fakes.wsgi_app())
+         self.assertEqual(res.status_int, 400)
+ 
++    def test_create_image_conflict_snapshot_v1_1(self):
++        """Attempt to create image when image is already being created."""
++        def snapshot(*args, **kwargs):
++            raise exception.InstanceSnapshotting
++        self.stubs.Set(nova.compute.API, 'snapshot', snapshot)
++
++        req = webob.Request.blank('/v1.1/fakes/servers/1/action')
++        req.method = 'POST'
++        req.body = json.dumps({
++            "createImage": {
++                "name": "test_snapshot",
++            },
++        })
++        req.headers["content-type"] = "application/json"
++        res = req.get_response(fakes.wsgi_app())
++        self.assertEqual(res.status_int, 409)
++
+     def test_create_instance_nonstring_name(self):
+         self._setup_for_create_instance()
+ 
+diff --git a/nova/tests/test_compute.py b/nova/tests/test_compute.py
+index 050d139..67dbe5e 100644
+--- a/nova/tests/test_compute.py
++++ b/nova/tests/test_compute.py
+@@ -24,6 +24,7 @@ from nova import compute
+ from nova.compute import instance_types
+ from nova.compute import manager as compute_manager
+ from nova.compute import power_state
++from nova.compute import task_states
+ from nova.compute import vm_states
+ from nova import context
+ from nova import db
+@@ -352,6 +353,36 @@ class ComputeTestCase(test.TestCase):
+         self.compute.snapshot_instance(self.context, instance_id, name)
+         self.compute.terminate_instance(self.context, instance_id)
+ 
++    def test_snapshot_conflict_backup(self):
++        """Can't backup an instance which is already being backed up."""
++        instance_id = self._create_instance()
++        instance_values = {'task_state': task_states.IMAGE_BACKUP}
++        db.instance_update(self.context, instance_id, instance_values)
++
++        self.assertRaises(exception.InstanceBackingUp,
++                          self.compute_api.backup,
++                          self.context,
++                          instance_id,
++                          None,
++                          None,
++                          None)
++
++        db.instance_destroy(self.context, instance_id)
++
++    def test_snapshot_conflict_snapshot(self):
++        """Can't snapshot an instance which is already being snapshotted."""
++        instance_id = self._create_instance()
++        instance_values = {'task_state': task_states.IMAGE_SNAPSHOT}
++        db.instance_update(self.context, instance_id, instance_values)
++
++        self.assertRaises(exception.InstanceSnapshotting,
++                          self.compute_api.snapshot,
++                          self.context,
++                          instance_id,
++                          None)
++
++        db.instance_destroy(self.context, instance_id)
++
+     def test_console_output(self):
+         """Make sure we can get console output from instance"""
+         instance_id = self._create_instance()
+-- 
+1.7.6.4
+
diff --git a/0009-Fixed-bug-lp850602.patch b/0018-Fixed-bug-lp850602.patch
similarity index 95%
rename from 0009-Fixed-bug-lp850602.patch
rename to 0018-Fixed-bug-lp850602.patch
index 64cc39a..b528eef 100644
--- a/0009-Fixed-bug-lp850602.patch
+++ b/0018-Fixed-bug-lp850602.patch
@@ -1,19 +1,19 @@
-From 4450fa948467552faf6e6f522666ff999baa1590 Mon Sep 17 00:00:00 2001
+From 744a0d8e7aa2c16fe55098c96cf9e46984838a4f Mon Sep 17 00:00:00 2001
 From: Kei Masumoto <masumotok at nttdata.co.jp>
 Date: Wed, 28 Sep 2011 15:05:54 -0400
-Subject: [PATCH] Fixed bug lp850602. Adding backing file copy operation on
- kvm block migration.
+Subject: [PATCH 18/40] Fixed bug lp850602. Adding backing file copy operation
+ on kvm block migration.
 
 (cherry picked from commit b9aac1181581b9036c98f5aa493731fdc74be7e1)
 
-Change-Id: I73e34447c46ab188e5769b9ea69ec52fdd69f8f9
+Change-Id: Ia2311ef0e65e97bad7e425ad6affdb5f864043ea
 ---
  nova/tests/test_libvirt.py      |   12 +++++++++---
  nova/virt/libvirt/connection.py |   33 ++++++++++++++++++++++++++++++---
  2 files changed, 39 insertions(+), 6 deletions(-)
 
 diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py
-index 60da454..2653636 100644
+index 8d28590..0f01de8 100644
 --- a/nova/tests/test_libvirt.py
 +++ b/nova/tests/test_libvirt.py
 @@ -794,7 +794,8 @@ class LibvirtConnTestCase(test.TestCase):
diff --git a/0019-bug-861310.patch b/0019-bug-861310.patch
new file mode 100644
index 0000000..7853a12
--- /dev/null
+++ b/0019-bug-861310.patch
@@ -0,0 +1,31 @@
+From 1def4abeeb6e03ad82906aaa6975c753d1649747 Mon Sep 17 00:00:00 2001
+From: Sateesh Chodapuneedi <sateesh.chodapuneedi at citrix.com>
+Date: Wed, 28 Sep 2011 18:07:22 +0530
+Subject: [PATCH 19/40] bug 861310
+
+Check if host list is not empty before trying to weigh the hosts.
+
+(cherry picked from commit 0546616926d7f95017405b4abb532a4517db7d90)
+
+Change-Id: I546690aaa750dc7de2b369c5843dd93cb0654489
+---
+ nova/scheduler/base_scheduler.py |    3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/nova/scheduler/base_scheduler.py b/nova/scheduler/base_scheduler.py
+index e9c078b..a9ec556 100644
+--- a/nova/scheduler/base_scheduler.py
++++ b/nova/scheduler/base_scheduler.py
+@@ -54,6 +54,9 @@ class BaseScheduler(abstract_scheduler.AbstractScheduler):
+         """Derived classes may override this to provide more sophisticated
+         scheduling objectives
+         """
++        # Make sure if there are compute hosts to serve the request.
++        if not hosts:
++            return []
+         # NOTE(sirp): The default logic is the same as the NoopCostFunction
+         hosts = [dict(weight=1, hostname=hostname, capabilities=capabilities)
+                  for hostname, capabilities in hosts]
+-- 
+1.7.6.4
+
diff --git a/0020-Enforce-snapshot-cleanup.patch b/0020-Enforce-snapshot-cleanup.patch
new file mode 100644
index 0000000..49f0e67
--- /dev/null
+++ b/0020-Enforce-snapshot-cleanup.patch
@@ -0,0 +1,90 @@
+From 5ff8e1cfa1b0ea22d7113b6d9fa729c8f43f1a19 Mon Sep 17 00:00:00 2001
+From: David Subiros <david.perez5 at hp.com>
+Date: Wed, 28 Sep 2011 15:19:04 +0100
+Subject: [PATCH 20/40] Enforce snapshot cleanup.
+
+Makes sure that the snapshot and the temporary directory is cleaned up,
+even if qemu-img fails. Fixes bug 861582.
+
+(cherry picked from commit eb6432361ee4946d93867e2d3f0870d892a25c66)
+
+Change-Id: I718021bfb7069c39a47e0da25d79acbf07f02a69
+---
+ Authors                         |    1 +
+ nova/virt/libvirt/connection.py |   48 ++++++++++++++++++++------------------
+ 2 files changed, 26 insertions(+), 23 deletions(-)
+
+diff --git a/Authors b/Authors
+index f3962c8..f23565b 100644
+--- a/Authors
++++ b/Authors
+@@ -28,6 +28,7 @@ Dan Prince <dan.prince at rackspace.com>
+ Dan Wendlandt <dan at nicira.com>
+ Dave Walker <DaveWalker at ubuntu.com>
+ David Pravec <David.Pravec at danix.org>
++David Subiros <david.perez5 at hp.com>
+ Dean Troyer <dtroyer at gmail.com>
+ Devendra Modium <dmodium at isi.edu>
+ Devin Carlen <devin.carlen at gmail.com>
+diff --git a/nova/virt/libvirt/connection.py b/nova/virt/libvirt/connection.py
+index 00be545..da00df0 100644
+--- a/nova/virt/libvirt/connection.py
++++ b/nova/virt/libvirt/connection.py
+@@ -445,29 +445,31 @@ class LibvirtConnection(driver.ComputeDriver):
+ 
+         # Export the snapshot to a raw image
+         temp_dir = tempfile.mkdtemp()
+-        out_path = os.path.join(temp_dir, snapshot_name)
+-        qemu_img_cmd = ('qemu-img',
+-                        'convert',
+-                        '-f',
+-                        source_format,
+-                        '-O',
+-                        image_format,
+-                        '-s',
+-                        snapshot_name,
+-                        disk_path,
+-                        out_path)
+-        utils.execute(*qemu_img_cmd)
+-
+-        # Upload that image to the image service
+-        with open(out_path) as image_file:
+-            image_service.update(context,
+-                                 image_href,
+-                                 metadata,
+-                                 image_file)
+-
+-        # Clean up
+-        shutil.rmtree(temp_dir)
+-        snapshot_ptr.delete(0)
++        try:
++            out_path = os.path.join(temp_dir, snapshot_name)
++            qemu_img_cmd = ('qemu-img',
++                            'convert',
++                            '-f',
++                            source_format,
++                            '-O',
++                            image_format,
++                            '-s',
++                            snapshot_name,
++                            disk_path,
++                            out_path)
++            utils.execute(*qemu_img_cmd)
++
++            # Upload that image to the image service
++            with open(out_path) as image_file:
++                image_service.update(context,
++                                     image_href,
++                                     metadata,
++                                     image_file)
++
++        finally:
++            # Clean up
++            shutil.rmtree(temp_dir)
++            snapshot_ptr.delete(0)
+ 
+     @exception.wrap_exception()
+     def reboot(self, instance, network_info, xml=None):
+-- 
+1.7.6.4
+
diff --git a/0021-bug-lp845714.patch b/0021-bug-lp845714.patch
new file mode 100644
index 0000000..0efd7f6
--- /dev/null
+++ b/0021-bug-lp845714.patch
@@ -0,0 +1,100 @@
+From 45b48835d8edb4c6caa597eb05c959b394434f92 Mon Sep 17 00:00:00 2001
+From: Aaron Lee <aaron.lee at rackspace.com>
+Date: Thu, 22 Sep 2011 17:07:27 -0500
+Subject: [PATCH 21/40] bug lp845714
+
+Kind of fixes it, this calls resize on the instance. The space will be
+available, but the partition won't be resized to use this space.
+Running fdisk -l will show the additional space(after a discussion here
+I was told this solution was best for the moment).
+
+Adding myself to Authors
+
+(cherry picked from commit 2dd0445dd60e5f0e845c49adbfb81acbebfc3ea8)
+
+Change-Id: I563bb92934445799892e1064a78c1c7e29a7237c
+---
+ nova/tests/test_xenapi.py  |    3 +++
+ nova/tests/xenapi/stubs.py |    3 ---
+ nova/virt/xenapi/fake.py   |    6 ++++++
+ nova/virt/xenapi/vmops.py  |    5 +++++
+ 4 files changed, 14 insertions(+), 3 deletions(-)
+
+diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py
+index e4fde88..82226e6 100644
+--- a/nova/tests/test_xenapi.py
++++ b/nova/tests/test_xenapi.py
+@@ -82,6 +82,7 @@ class XenAPIVolumeTestCase(test.TestCase):
+                   'image_ref': 1,
+                   'kernel_id': 2,
+                   'ramdisk_id': 3,
++                  'local_gb': 20,
+                   'instance_type_id': '3',  # m1.large
+                   'os_type': 'linux',
+                   'architecture': 'x86-64'}
+@@ -375,6 +376,7 @@ class XenAPIVMTestCase(test.TestCase):
+                       'image_ref': image_ref,
+                       'kernel_id': kernel_id,
+                       'ramdisk_id': ramdisk_id,
++                      'local_gb': 20,
+                       'instance_type_id': instance_type_id,
+                       'os_type': os_type,
+                       'hostname': hostname,
+@@ -651,6 +653,7 @@ class XenAPIVMTestCase(test.TestCase):
+             'image_ref': 1,
+             'kernel_id': 2,
+             'ramdisk_id': 3,
++            'local_gb': 20,
+             'instance_type_id': '3',  # m1.large
+             'os_type': 'linux',
+             'architecture': 'x86-64'}
+diff --git a/nova/tests/xenapi/stubs.py b/nova/tests/xenapi/stubs.py
+index 647a4c1..49cdc1f 100644
+--- a/nova/tests/xenapi/stubs.py
++++ b/nova/tests/xenapi/stubs.py
+@@ -282,9 +282,6 @@ class FakeSessionForMigrationTests(fake.SessionBase):
+     def VDI_get_by_uuid(self, *args):
+         return 'hurr'
+ 
+-    def VDI_resize_online(self, *args):
+-        pass
+-
+     def VM_start(self, _1, ref, _2, _3):
+         vm = fake.get_record('VM', ref)
+         if vm['power_state'] != 'Halted':
+diff --git a/nova/virt/xenapi/fake.py b/nova/virt/xenapi/fake.py
+index 97dfd9f..475ed54 100644
+--- a/nova/virt/xenapi/fake.py
++++ b/nova/virt/xenapi/fake.py
+@@ -378,6 +378,12 @@ class SessionBase(object):
+     def host_call_plugin(self, *args):
+         return 'herp'
+ 
++    def VDI_resize_online(self, *args):
++        return 'derp'
++
++    def VM_clean_reboot(self, *args):
++        return 'burp'
++
+     def network_get_all_records_where(self, _1, filter):
+         return self.xenapi.network.get_all_records()
+ 
+diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
+index f483758..446b623 100644
+--- a/nova/virt/xenapi/vmops.py
++++ b/nova/virt/xenapi/vmops.py
+@@ -140,6 +140,11 @@ class VMOps(object):
+                 instance, instance.image_ref,
+                 instance.user_id, instance.project_id,
+                 disk_image_type)
++
++        for vdi in vdis:
++            if vdi["vdi_type"] == "os":
++                self.resize_instance(instance, vdi["vdi_uuid"])
++
+         return vdis
+ 
+     def spawn(self, context, instance, network_info):
+-- 
+1.7.6.4
+
diff --git a/0022-Added-1.0.4-version-specifier-to-kombu-in-pip-requir.patch b/0022-Added-1.0.4-version-specifier-to-kombu-in-pip-requir.patch
new file mode 100644
index 0000000..f32e65e
--- /dev/null
+++ b/0022-Added-1.0.4-version-specifier-to-kombu-in-pip-requir.patch
@@ -0,0 +1,31 @@
+From 74ce079c65b4283de58d46cf63943db2860a06fe Mon Sep 17 00:00:00 2001
+From: Brian Lamar <brian.lamar at rackspace.com>
+Date: Thu, 29 Sep 2011 15:55:42 -0400
+Subject: [PATCH 22/40] Added ==1.0.4 version specifier to kombu in
+ pip-requires to ensure tests pass in a clean venv.
+
+Fixes bug 862629.
+
+(cherry picked from commit eb4bd86f65a440b39804d16e477aeb77f31e11c1)
+
+Change-Id: I7f8f327633eed21067cfb48bade84da04bdf1780
+---
+ tools/pip-requires |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/tools/pip-requires b/tools/pip-requires
+index 232887c..26c639b 100644
+--- a/tools/pip-requires
++++ b/tools/pip-requires
+@@ -8,7 +8,7 @@ anyjson==0.2.4
+ boto==1.9b
+ carrot==0.10.5
+ eventlet
+-kombu
++kombu==1.0.4
+ lockfile==0.8
+ lxml==2.3
+ python-novaclient==2.6.0
+-- 
+1.7.6.4
+
diff --git a/0023-Adds-the-tenant-id-to-the-create-images-response-Loc.patch b/0023-Adds-the-tenant-id-to-the-create-images-response-Loc.patch
new file mode 100644
index 0000000..f4f9531
--- /dev/null
+++ b/0023-Adds-the-tenant-id-to-the-create-images-response-Loc.patch
@@ -0,0 +1,55 @@
+From 6f96fa65aa73e7803c9ba82d7a4f3b49b310e1b7 Mon Sep 17 00:00:00 2001
+From: Alex Meade <alex.meade at rackspace.com>
+Date: Thu, 29 Sep 2011 15:58:43 -0400
+Subject: [PATCH 23/40] Adds the tenant id to the create images response
+ Location header Fixes bug 862672
+
+(cherry picked from commit f3fb16a7935e91f8c9034d1da84a2b17cbe186f8)
+
+Change-Id: I97357dc76561db576d354eacf4d7756c664e0580
+---
+ nova/api/openstack/servers.py                   |    5 ++++-
+ nova/tests/api/openstack/test_server_actions.py |    4 ++--
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
+index 94c4e99..fc14234 100644
+--- a/nova/api/openstack/servers.py
++++ b/nova/api/openstack/servers.py
+@@ -822,7 +822,10 @@ class ControllerV11(Controller):
+ 
+         # build location of newly-created image entity
+         image_id = str(image['id'])
+-        image_ref = os.path.join(req.application_url, 'images', image_id)
++        image_ref = os.path.join(req.application_url,
++                                 context.project_id,
++                                 'images',
++                                 image_id)
+ 
+         resp = webob.Response(status_int=202)
+         resp.headers['Location'] = image_ref
+diff --git a/nova/tests/api/openstack/test_server_actions.py b/nova/tests/api/openstack/test_server_actions.py
+index b9ef414..6a0feda 100644
+--- a/nova/tests/api/openstack/test_server_actions.py
++++ b/nova/tests/api/openstack/test_server_actions.py
+@@ -868,7 +868,7 @@ class ServerActionsTestV11(test.TestCase):
+         response = req.get_response(fakes.wsgi_app())
+         self.assertEqual(202, response.status_int)
+         location = response.headers['Location']
+-        self.assertEqual('http://localhost/v1.1/images/123', location)
++        self.assertEqual('http://localhost/v1.1/fake/images/123', location)
+ 
+     def test_create_image_snapshots_disabled(self):
+         """Don't permit a snapshot if the allow_instance_snapshots flag is
+@@ -901,7 +901,7 @@ class ServerActionsTestV11(test.TestCase):
+         response = req.get_response(fakes.wsgi_app())
+         self.assertEqual(202, response.status_int)
+         location = response.headers['Location']
+-        self.assertEqual('http://localhost/v1.1/images/123', location)
++        self.assertEqual('http://localhost/v1.1/fake/images/123', location)
+ 
+     def test_create_image_with_too_much_metadata(self):
+         body = {
+-- 
+1.7.6.4
+
diff --git a/0024-Fixes-bug-862633-OS-api-consoles-create-broken.patch b/0024-Fixes-bug-862633-OS-api-consoles-create-broken.patch
new file mode 100644
index 0000000..71c8694
--- /dev/null
+++ b/0024-Fixes-bug-862633-OS-api-consoles-create-broken.patch
@@ -0,0 +1,270 @@
+From b797f1ddffe331d6663f6f53f8a823442c8c3650 Mon Sep 17 00:00:00 2001
+From: Chris Behrens <cbehrens at codestud.com>
+Date: Thu, 29 Sep 2011 20:54:19 +0000
+Subject: [PATCH 24/40] Fixes bug 862633 -- OS api consoles create() broken
+
+Fixed and added tests for OS API consoles.py which didn't exist.
+
+(cherry picked from commit 7a10619a4c1f5a1880ab613f782b4cbe1d57fad4)
+
+Change-Id: Ia2bbeb3d09c474ca008f53d03fa9996d3d9043de
+---
+ nova/api/openstack/consoles.py            |    2 +-
+ nova/tests/api/openstack/test_consoles.py |  232 +++++++++++++++++++++++++++++
+ 2 files changed, 233 insertions(+), 1 deletions(-)
+ create mode 100644 nova/tests/api/openstack/test_consoles.py
+
+diff --git a/nova/api/openstack/consoles.py b/nova/api/openstack/consoles.py
+index d2655ac..8f6dbaa 100644
+--- a/nova/api/openstack/consoles.py
++++ b/nova/api/openstack/consoles.py
+@@ -57,7 +57,7 @@ class Controller(object):
+         return dict(consoles=[_translate_keys(console)
+                               for console in consoles])
+ 
+-    def create(self, req, server_id, body):
++    def create(self, req, server_id):
+         """Creates a new console"""
+         self.console_api.create_console(
+                                 req.environ['nova.context'],
+diff --git a/nova/tests/api/openstack/test_consoles.py b/nova/tests/api/openstack/test_consoles.py
+new file mode 100644
+index 0000000..28c04d0
+--- /dev/null
++++ b/nova/tests/api/openstack/test_consoles.py
+@@ -0,0 +1,232 @@
++# vim: tabstop=4 shiftwidth=4 softtabstop=4
++
++# Copyright 2010-2011 OpenStack LLC.
++# Copyright 2011 Piston Cloud Computing, Inc.
++# 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
++#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
++#    License for the specific language governing permissions and limitations
++#    under the License.
++
++import datetime
++import json
++import webob
++
++from nova.api.openstack import consoles
++from nova import console
++from nova import db
++from nova.compute import vm_states
++from nova import exception
++from nova import flags
++from nova import test
++from nova.tests.api.openstack import common
++from nova.tests.api.openstack import fakes
++from nova import utils
++
++
++FLAGS = flags.FLAGS
++FAKE_UUID = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
++
++
++def return_server_by_id(context, id):
++    print "GOT HERE"
++    return stub_instance(id)
++
++
++def stub_instance(id, user_id='fake', project_id='fake', host=None,
++                  vm_state=None, task_state=None,
++                  reservation_id="", uuid=FAKE_UUID, image_ref="10",
++                  flavor_id="1", name=None, key_name='',
++                  access_ipv4=None, access_ipv6=None, progress=0):
++
++    if host is not None:
++        host = str(host)
++
++    if key_name:
++        key_data = 'FAKE'
++    else:
++        key_data = ''
++
++    # ReservationID isn't sent back, hack it in there.
++    server_name = name or "server%s" % id
++    if reservation_id != "":
++        server_name = "reservation_%s" % (reservation_id, )
++
++    instance = {
++        "id": int(id),
++        "uuid": FAKE_UUID,
++        "created_at": datetime.datetime(2010, 10, 10, 12, 0, 0),
++        "updated_at": datetime.datetime(2010, 11, 11, 11, 0, 0),
++        "admin_pass": "",
++        "user_id": user_id,
++        "project_id": project_id,
++        "image_ref": image_ref,
++        "kernel_id": "",
++        "ramdisk_id": "",
++        "launch_index": 0,
++        "key_name": key_name,
++        "key_data": key_data,
++        "vm_state": vm_state or vm_states.BUILDING,
++        "task_state": task_state,
++        "memory_mb": 0,
++        "vcpus": 0,
++        "local_gb": 0,
++        "hostname": "",
++        "host": host,
++        "instance_type": {},
++        "user_data": "",
++        "reservation_id": reservation_id,
++        "mac_address": "",
++        "scheduled_at": utils.utcnow(),
++        "launched_at": utils.utcnow(),
++        "terminated_at": utils.utcnow(),
++        "availability_zone": "",
++        "display_name": server_name,
++        "display_description": "",
++        "locked": False,
++        "metadata": [],
++        "access_ip_v4": access_ipv4,
++        "access_ip_v6": access_ipv6,
++        "uuid": uuid,
++        "progress": progress}
++
++    return instance
++
++
++class ConsolesTest(test.TestCase):
++    def setUp(self):
++        super(ConsolesTest, self).setUp()
++        self.flags(verbose=True)
++        self.stubs.Set(db.api, 'instance_get', return_server_by_id)
++        self.webreq = common.webob_factory('/v1.0/servers')
++
++    def test_create_console(self):
++        def fake_create_console(cons_self, context, instance_id):
++            self.assertTrue(instance_id, 10)
++            return {}
++        self.stubs.Set(console.API, 'create_console', fake_create_console)
++
++        req = webob.Request.blank('/v1.0/servers/10/consoles')
++        req.method = "POST"
++        res = req.get_response(fakes.wsgi_app())
++        self.assertEqual(res.status_int, 200)
++
++    def test_show_console(self):
++        def fake_get_console(cons_self, context, instance_id, console_id):
++            self.assertEqual(instance_id, 10)
++            self.assertEqual(console_id, 20)
++            pool = dict(console_type='fake_type',
++                    public_hostname='fake_hostname')
++            return dict(id=console_id, password='fake_password',
++                    port='fake_port', pool=pool)
++
++        expected = {'console': {'id': 20,
++                                'port': 'fake_port',
++                                'host': 'fake_hostname',
++                                'password': 'fake_password',
++                                'console_type': 'fake_type'}}
++
++        self.stubs.Set(console.API, 'get_console', fake_get_console)
++
++        req = webob.Request.blank('/v1.0/servers/10/consoles/20')
++        res = req.get_response(fakes.wsgi_app())
++        self.assertEqual(res.status_int, 200)
++        res_dict = json.loads(res.body)
++        self.assertDictMatch(res_dict, expected)
++
++    def test_show_console_unknown_console(self):
++        def fake_get_console(cons_self, context, instance_id, console_id):
++            raise exception.ConsoleNotFound(console_id=console_id)
++
++        self.stubs.Set(console.API, 'get_console', fake_get_console)
++
++        req = webob.Request.blank('/v1.0/servers/10/consoles/20')
++        res = req.get_response(fakes.wsgi_app())
++        self.assertEqual(res.status_int, 404)
++
++    def test_show_console_unknown_instance(self):
++        def fake_get_console(cons_self, context, instance_id, console_id):
++            raise exception.InstanceNotFound(instance_id=instance_id)
++
++        self.stubs.Set(console.API, 'get_console', fake_get_console)
++
++        req = webob.Request.blank('/v1.0/servers/10/consoles/20')
++        res = req.get_response(fakes.wsgi_app())
++        self.assertEqual(res.status_int, 404)
++
++    def test_list_consoles(self):
++        def fake_get_consoles(cons_self, context, instance_id):
++            self.assertEqual(instance_id, 10)
++
++            pool1 = dict(console_type='fake_type',
++                    public_hostname='fake_hostname')
++            cons1 = dict(id=10, password='fake_password',
++                    port='fake_port', pool=pool1)
++            pool2 = dict(console_type='fake_type2',
++                    public_hostname='fake_hostname2')
++            cons2 = dict(id=11, password='fake_password2',
++                    port='fake_port2', pool=pool2)
++            return [cons1, cons2]
++
++        expected = {'consoles':
++                [{'console': {'id': 10, 'console_type': 'fake_type'}},
++                 {'console': {'id': 11, 'console_type': 'fake_type2'}}]}
++
++        self.stubs.Set(console.API, 'get_consoles', fake_get_consoles)
++
++        req = webob.Request.blank('/v1.0/servers/10/consoles')
++        res = req.get_response(fakes.wsgi_app())
++        self.assertEqual(res.status_int, 200)
++        res_dict = json.loads(res.body)
++        self.assertDictMatch(res_dict, expected)
++
++    def test_delete_console(self):
++        def fake_get_console(cons_self, context, instance_id, console_id):
++            self.assertEqual(instance_id, 10)
++            self.assertEqual(console_id, 20)
++            pool = dict(console_type='fake_type',
++                    public_hostname='fake_hostname')
++            return dict(id=console_id, password='fake_password',
++                    port='fake_port', pool=pool)
++
++        def fake_delete_console(cons_self, context, instance_id, console_id):
++            self.assertEqual(instance_id, 10)
++            self.assertEqual(console_id, 20)
++
++        self.stubs.Set(console.API, 'get_console', fake_get_console)
++        self.stubs.Set(console.API, 'delete_console', fake_delete_console)
++
++        req = webob.Request.blank('/v1.0/servers/10/consoles/20')
++        req.method = "DELETE"
++        res = req.get_response(fakes.wsgi_app())
++        self.assertEqual(res.status_int, 202)
++
++    def test_show_console_unknown_console(self):
++        def fake_delete_console(cons_self, context, instance_id, console_id):
++            raise exception.ConsoleNotFound(console_id=console_id)
++
++        self.stubs.Set(console.API, 'delete_console', fake_delete_console)
++
++        req = webob.Request.blank('/v1.0/servers/10/consoles/20')
++        req.method = "DELETE"
++        res = req.get_response(fakes.wsgi_app())
++        self.assertEqual(res.status_int, 404)
++
++    def test_show_console_unknown_instance(self):
++        def fake_delete_console(cons_self, context, instance_id, console_id):
++            raise exception.InstanceNotFound(instance_id=instance_id)
++
++        self.stubs.Set(console.API, 'delete_console', fake_delete_console)
++
++        req = webob.Request.blank('/v1.0/servers/10/consoles/20')
++        req.method = "DELETE"
++        res = req.get_response(fakes.wsgi_app())
++        self.assertEqual(res.status_int, 404)
+-- 
+1.7.6.4
+
diff --git a/0025-Deallocate-ip-if-build-fails.patch b/0025-Deallocate-ip-if-build-fails.patch
new file mode 100644
index 0000000..7218f78
--- /dev/null
+++ b/0025-Deallocate-ip-if-build-fails.patch
@@ -0,0 +1,159 @@
+From 87823bbc4940e585e9b2fa2d83d1a89d43c29275 Mon Sep 17 00:00:00 2001
+From: Rick Harris <rconradharris at gmail.com>
+Date: Tue, 27 Sep 2011 21:05:31 +0000
+Subject: [PATCH 25/40] Deallocate ip if build fails.
+
+Fixes LP837687
+
+(cherry picked from commit f225ea4f2ffcf0343722aa370dd615ee0effe305)
+
+Change-Id: Ia3cf273178094564af4acf8629c7d1de9d55375f
+---
+ nova/compute/manager.py |   74 +++++++++++++++++++++++++++++++---------------
+ run_tests.sh            |   17 ++++++++++-
+ 2 files changed, 66 insertions(+), 25 deletions(-)
+
+diff --git a/nova/compute/manager.py b/nova/compute/manager.py
+index e575402..5feb840 100644
+--- a/nova/compute/manager.py
++++ b/nova/compute/manager.py
+@@ -360,6 +360,42 @@ class ComputeManager(manager.SchedulerDependentManager):
+                            % locals())
+                 raise exception.ImageTooLarge()
+ 
++        def _make_network_info():
++            if FLAGS.stub_network:
++                # TODO(tr3buchet) not really sure how this should be handled.
++                # virt requires network_info to be passed in but stub_network
++                # is enabled. Setting to [] for now will cause virt to skip
++                # all vif creation and network injection, maybe this is correct
++                network_info = []
++            else:
++                # NOTE(vish): This could be a cast because we don't do
++                # anything with the address currently, but I'm leaving it as a
++                # call to ensure that network setup completes.  We will
++                # eventually also need to save the address here.
++                network_info = self.network_api.allocate_for_instance(context,
++                                    instance, vpn=is_vpn,
++                                    requested_networks=requested_networks)
++                LOG.debug(_("instance network_info: |%s|"), network_info)
++            return network_info
++
++        def _make_block_device_info():
++            (swap, ephemerals,
++             block_device_mapping) = self._setup_block_device_mapping(
++                context, instance_id)
++            block_device_info = {
++                'root_device_name': instance['root_device_name'],
++                'swap': swap,
++                'ephemerals': ephemerals,
++                'block_device_mapping': block_device_mapping}
++            return block_device_info
++
++        def _deallocate_network():
++            if not FLAGS.stub_network:
++                LOG.debug(_("deallocating network for instance: %s"),
++                          instance['id'])
++                self.network_api.deallocate_for_instance(context,
++                                    instance)
++
+         context = context.elevated()
+         instance = self.db.instance_get(context, instance_id)
+ 
+@@ -382,36 +418,14 @@ class ComputeManager(manager.SchedulerDependentManager):
+         instance['admin_pass'] = kwargs.get('admin_password', None)
+ 
+         is_vpn = instance['image_ref'] == str(FLAGS.vpn_image_id)
++        network_info = _make_network_info()
+         try:
+-            # NOTE(vish): This could be a cast because we don't do anything
+-            #             with the address currently, but I'm leaving it as
+-            #             a call to ensure that network setup completes.  We
+-            #             will eventually also need to save the address here.
+-            if not FLAGS.stub_network:
+-                network_info = self.network_api.allocate_for_instance(context,
+-                                    instance, vpn=is_vpn,
+-                                    requested_networks=requested_networks)
+-                LOG.debug(_("instance network_info: |%s|"), network_info)
+-            else:
+-                # TODO(tr3buchet) not really sure how this should be handled.
+-                # virt requires network_info to be passed in but stub_network
+-                # is enabled. Setting to [] for now will cause virt to skip
+-                # all vif creation and network injection, maybe this is correct
+-                network_info = []
+-
+             self._instance_update(context,
+                                   instance_id,
+                                   vm_state=vm_states.BUILDING,
+                                   task_state=task_states.BLOCK_DEVICE_MAPPING)
+ 
+-            (swap, ephemerals,
+-             block_device_mapping) = self._setup_block_device_mapping(
+-                context, instance_id)
+-            block_device_info = {
+-                'root_device_name': instance['root_device_name'],
+-                'swap': swap,
+-                'ephemerals': ephemerals,
+-                'block_device_mapping': block_device_mapping}
++            block_device_info = _make_block_device_info()
+ 
+             self._instance_update(context,
+                                   instance_id,
+@@ -427,6 +441,7 @@ class ComputeManager(manager.SchedulerDependentManager):
+                         "virtualization enabled in the BIOS? Details: "
+                         "%(ex)s") % locals()
+                 LOG.exception(msg)
++                _deallocate_network()
+                 return
+ 
+             current_power_state = self._get_power_state(context, instance)
+@@ -448,6 +463,17 @@ class ComputeManager(manager.SchedulerDependentManager):
+             # deleted before it actually got created.  This should
+             # be fixed once we have no-db-messaging
+             pass
++        except:
++            # NOTE(sirp): 3-arg raise needed since Eventlet clears exceptions
++            # when switching between greenthreads.
++            type_, value, traceback = sys.exc_info()
++            try:
++                _deallocate_network()
++            finally:
++                # FIXME(sirp): when/if
++                # https://github.com/jcrocholl/pep8/pull/27 merges, we can add
++                # a per-line disable flag here for W602
++                raise type_, value, traceback
+ 
+     @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
+     def run_instance(self, context, instance_id, **kwargs):
+diff --git a/run_tests.sh b/run_tests.sh
+index b2567fe..9a69195 100755
+--- a/run_tests.sh
++++ b/run_tests.sh
+@@ -89,8 +89,23 @@ function run_pep8 {
+   srcfiles+=" `find tools/*`"
+   srcfiles+=" nova setup.py plugins/xenserver/xenapi/etc/xapi.d/plugins/glance"
+   # Just run PEP8 in current environment
++  #
++  # NOTE(sirp): W602 (deprecated 3-arg raise) is being ignored for the
++  # following reasons:
++  #
++  #  1. It's needed to preserve traceback information when re-raising
++  #     exceptions; this is needed b/c Eventlet will clear exceptions when
++  #     switching contexts.
++  #
++  #  2. There doesn't appear to be an alternative, "pep8-tool" compatible way of doing this
++  #     in Python 2 (in Python 3 `with_traceback` could be used).
++  #
++  #  3. Can find no corroborating evidence that this is deprecated in Python 2
++  #     other than what the PEP8 tool claims. It is deprecated in Python 3, so,
++  #     perhaps the mistake was thinking that the deprecation applied to Python 2
++  #     as well.
+   ${wrapper} pep8 --repeat --show-pep8 --show-source \
+-    --ignore=E202 \
++    --ignore=E202,W602 \
+     --exclude=vcsversion.py ${srcfiles}
+ }
+ 
+-- 
+1.7.6.4
+
diff --git a/0010-Stop-returning-correct-password-on-api-calls.patch b/0026-Stop-returning-correct-password-on-api-calls.patch
similarity index 91%
rename from 0010-Stop-returning-correct-password-on-api-calls.patch
rename to 0026-Stop-returning-correct-password-on-api-calls.patch
index 09f1af3..8ea043e 100644
--- a/0010-Stop-returning-correct-password-on-api-calls.patch
+++ b/0026-Stop-returning-correct-password-on-api-calls.patch
@@ -1,7 +1,7 @@
-From f76a2ecca3463c692cf5bad8384eafe677780e08 Mon Sep 17 00:00:00 2001
+From b1ab6da1495784ff581000018a6047fd19cf82c4 Mon Sep 17 00:00:00 2001
 From: Ahmad Hassan <ahmad.hassan at hp.com>
 Date: Mon, 1 Aug 2011 17:16:49 +0100
-Subject: [PATCH] Stop returning correct password on api calls
+Subject: [PATCH 26/40] Stop returning correct password on api calls
 
 Captured invalid signature exception in authentication step, so that
 the problem is not returning exception to user, revealing the real
@@ -11,8 +11,6 @@ Fixes bug 868360.
 (cherry picked from commit beee11edbfdd82cd81bc9c0fd75912c167892c2b)
 
 Change-Id: I5d6f713358dc720514b3e693f9adb11ccacecdd0
-
-(cherry picked from commit b1ab6da1495784ff581000018a6047fd19cf82c4)
 ---
  Authors                  |    1 +
  nova/api/ec2/__init__.py |    3 ++-
@@ -20,10 +18,11 @@ Change-Id: I5d6f713358dc720514b3e693f9adb11ccacecdd0
  3 files changed, 5 insertions(+), 9 deletions(-)
 
 diff --git a/Authors b/Authors
-index 8d6837e..53b3f6c 100644
+index f23565b..cc1fb78 100644
 --- a/Authors
 +++ b/Authors
-@@ -1,5 +1,6 @@
+@@ -1,6 +1,7 @@
+ Aaron Lee <aaron.lee at rackspace.com>
  Adam Gandelman <adamg at canonical.com>
  Adam Johnson <adjohn at gmail.com>
 +Ahmad Hassan <ahmad.hassan at hp.com>
diff --git a/0027-Handle-pidfile-exception-for-dnsmasq.patch b/0027-Handle-pidfile-exception-for-dnsmasq.patch
new file mode 100644
index 0000000..29d0ff4
--- /dev/null
+++ b/0027-Handle-pidfile-exception-for-dnsmasq.patch
@@ -0,0 +1,51 @@
+From ad4eef0a0b296652f8ce08d86a10dea8a40b005b Mon Sep 17 00:00:00 2001
+From: Yun Shen <Yun.Shen at hp.com>
+Date: Thu, 29 Sep 2011 12:09:37 +0100
+Subject: [PATCH 27/40] Handle pidfile exception for dnsmasq
+
+Capture the exception in dnsmasq_pid_for method. If the pidfile cannot be read
+for some reason, it should be treated as if it does not exist. This prevents
+issues where the filesystem write delay leaves the file created but empty.
+Fixes bug 865399.
+
+(cherry picked from commit a25f106c2f824d7d03bf1161da72f66fe4be5a9c)
+
+Change-Id: Ifd79c7143060702bfe359f0e0a35867c685e27df
+---
+ Authors                   |    1 +
+ nova/network/linux_net.py |    7 +++++--
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/Authors b/Authors
+index cc1fb78..adb2bbc 100644
+--- a/Authors
++++ b/Authors
+@@ -120,6 +120,7 @@ Vladimir Popovski <vladimir at zadarastorage.com>
+ William Wolf <throughnothing at gmail.com>
+ Yoshiaki Tamura <yoshi at midokura.jp>
+ Youcef Laribi <Youcef.Laribi at eu.citrix.com>
++Yun Shen <Yun.Shen at hp.com>
+ Yuriy Taraday <yorik.sar at gmail.com>
+ Zhixue Wu <Zhixue.Wu at citrix.com>
+ Zed Shaw <zedshaw at zedshaw.com>
+diff --git a/nova/network/linux_net.py b/nova/network/linux_net.py
+index 5370f37..c0be962 100755
+--- a/nova/network/linux_net.py
++++ b/nova/network/linux_net.py
+@@ -793,8 +793,11 @@ def _dnsmasq_pid_for(dev):
+     pid_file = _dhcp_file(dev, 'pid')
+ 
+     if os.path.exists(pid_file):
+-        with open(pid_file, 'r') as f:
+-            return int(f.read())
++        try:
++            with open(pid_file, 'r') as f:
++                return int(f.read())
++        except (ValueError, IOError):
++            return None
+ 
+ 
+ def _ra_pid_for(dev):
+-- 
+1.7.6.4
+
diff --git a/0028-Make-sure-unknown-extensions-return-404.patch b/0028-Make-sure-unknown-extensions-return-404.patch
new file mode 100644
index 0000000..9b14d0e
--- /dev/null
+++ b/0028-Make-sure-unknown-extensions-return-404.patch
@@ -0,0 +1,58 @@
+From 0ca35753f5f5a506162fde679ae7719d5d22f8e0 Mon Sep 17 00:00:00 2001
+From: Ahmad Hassan <ahmad.hassan at hp.com>
+Date: Wed, 5 Oct 2011 17:02:45 +0100
+Subject: [PATCH 28/40] Make sure unknown extensions return 404
+
+At the moment, if an extension doens't exist and we call a show method
+with wrong id then the exception is not captured. There is a need to
+return NOTFOUND exception.
+Fixes bug 869153.
+
+(cherry picked from commit 2915e6ba054b1f4100f788603358ea5b2b8220d5)
+
+Change-Id: Ia20acf28389ca91308b62388e1e0d2fe4c227047
+---
+ nova/api/openstack/extensions.py            |    8 ++++++--
+ nova/tests/api/openstack/test_extensions.py |    7 +++++++
+ 2 files changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/nova/api/openstack/extensions.py b/nova/api/openstack/extensions.py
+index efede94..a77a91b 100644
+--- a/nova/api/openstack/extensions.py
++++ b/nova/api/openstack/extensions.py
+@@ -195,8 +195,12 @@ class ExtensionsResource(wsgi.Resource):
+         return dict(extensions=extensions)
+ 
+     def show(self, req, id):
+-        # NOTE(dprince): the extensions alias is used as the 'id' for show
+-        ext = self.extension_manager.extensions[id]
++        try:
++            # NOTE(dprince): the extensions alias is used as the 'id' for show
++            ext = self.extension_manager.extensions[id]
++        except KeyError:
++            return faults.Fault(webob.exc.HTTPNotFound())
++
+         return dict(extension=self._translate(ext))
+ 
+     def delete(self, req, id):
+diff --git a/nova/tests/api/openstack/test_extensions.py b/nova/tests/api/openstack/test_extensions.py
+index 44f4eb0..0e9f9fa 100644
+--- a/nova/tests/api/openstack/test_extensions.py
++++ b/nova/tests/api/openstack/test_extensions.py
+@@ -146,6 +146,13 @@ class ExtensionControllerTest(test.TestCase):
+                 "alias": "FOXNSOX",
+                 "links": []})
+ 
++    def test_get_non_existing_extension_json(self):
++        app = openstack.APIRouterV11()
++        ext_midware = extensions.ExtensionMiddleware(app)
++        request = webob.Request.blank("/123/extensions/4")
++        response = request.get_response(ext_midware)
++        self.assertEqual(404, response.status_int)
++
+     def test_list_extensions_xml(self):
+         app = openstack.APIRouterV11()
+         ext_midware = extensions.ExtensionMiddleware(app)
+-- 
+1.7.6.4
+
diff --git a/0029-Include-original-exception-in-ClassNotFound-exceptio.patch b/0029-Include-original-exception-in-ClassNotFound-exceptio.patch
new file mode 100644
index 0000000..f3e611d
--- /dev/null
+++ b/0029-Include-original-exception-in-ClassNotFound-exceptio.patch
@@ -0,0 +1,93 @@
+From 21393e64b9524b89d373d2d303afce38919c96c2 Mon Sep 17 00:00:00 2001
+From: Julien Danjou <julien.danjou at enovance.com>
+Date: Thu, 6 Oct 2011 17:15:32 +0200
+Subject: [PATCH 29/40] Include original exception in ClassNotFound exception
+
+By doing this, we allow the error messages to be more useful. When an import
+of a class fails because of a missing module dependency, it would have fail
+that way for example:
+
+$ nova-manage
+Traceback (most recent call last):
+  File "./bin/nova-manage", line 84, in <module>
+    from nova import image
+  File "/home/jd/Work/src/nova/nova/image/__init__.py", line 22, in <module>
+    from nova.image import glance
+  File "/home/jd/Work/src/nova/nova/image/glance.py", line 42, in <module>
+    GlanceClient = utils.import_class('glance.client.Client')
+  File "/home/jd/Work/src/nova/nova/utils.py", line 66, in import_class
+    raise exception.ClassNotFound(class_name=class_str)
+nova.exception.ClassNotFound: Class Client could not be found
+
+This does not help the user, since it indicates the class Client cannot be
+found, even if it is actually found but fail to import.
+
+With this commit, the error message is better:
+nova-manage
+Traceback (most recent call last):
+  File "./bin/nova-manage", line 84, in <module>
+    from nova import image
+  File "/home/jd/Work/src/nova/nova/image/__init__.py", line 22, in <module>
+    from nova.image import glance
+  File "/home/jd/Work/src/nova/nova/image/glance.py", line 42, in <module>
+    GlanceClient = utils.import_class('glance.client.Client')
+  File "/home/jd/Work/src/nova/nova/utils.py", line 66, in import_class
+    raise exception.ClassNotFound(class_name=class_str, exception=exc)
+nova.exception.ClassNotFound: Class Client could not be found: No module named kombu.connection
+
+This helps to know that in this kombu is missing.
+
+It would probably even better to rename ClassNotFound to
+ClassCannotBeImported or something like that too.
+
+(cherry picked from commit 33e58925c75b66c6800d3ba6068ee1e4f0db6617)
+
+Change-Id: I50c591b54820ae734e5d1dccedf6653c5c9d40f9
+Signed-off-by: Julien Danjou <julien.danjou at enovance.com>
+---
+ Authors           |    1 +
+ nova/exception.py |    2 +-
+ nova/utils.py     |    2 +-
+ 3 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/Authors b/Authors
+index adb2bbc..cc78535 100644
+--- a/Authors
++++ b/Authors
+@@ -63,6 +63,7 @@ Josh Durgin <joshd at hq.newdream.net>
+ Josh Kearney <josh at jk0.org>
+ Josh Kleinpeter <josh at kleinpeter.org>
+ Joshua McKenty <jmckenty at gmail.com>
++Julien Danjou <julien.danjou at enovance.com>
+ Justin Santa Barbara <justin at fathomdb.com>
+ Justin Shepherd <jshepher at rackspace.com>
+ Kei Masumoto <masumotok at nttdata.co.jp>
+diff --git a/nova/exception.py b/nova/exception.py
+index 79b1bf3..b88e8e5 100644
+--- a/nova/exception.py
++++ b/nova/exception.py
+@@ -727,7 +727,7 @@ class NetworkAdapterNotFound(NotFound):
+ 
+ 
+ class ClassNotFound(NotFound):
+-    message = _("Class %(class_name)s could not be found")
++    message = _("Class %(class_name)s could not be found: %(exception)s")
+ 
+ 
+ class NotAllowed(NovaException):
+diff --git a/nova/utils.py b/nova/utils.py
+index 81157a4..c64b11f 100644
+--- a/nova/utils.py
++++ b/nova/utils.py
+@@ -63,7 +63,7 @@ def import_class(import_str):
+         return getattr(sys.modules[mod_str], class_str)
+     except (ImportError, ValueError, AttributeError), exc:
+         LOG.debug(_('Inner Exception: %s'), exc)
+-        raise exception.ClassNotFound(class_name=class_str)
++        raise exception.ClassNotFound(class_name=class_str, exception=exc)
+ 
+ 
+ def import_object(import_str):
+-- 
+1.7.6.4
+
diff --git a/0030-Ensure-non-default-FLAGS.logfile_mode-is-properly-co.patch b/0030-Ensure-non-default-FLAGS.logfile_mode-is-properly-co.patch
new file mode 100644
index 0000000..f3db1ff
--- /dev/null
+++ b/0030-Ensure-non-default-FLAGS.logfile_mode-is-properly-co.patch
@@ -0,0 +1,49 @@
+From fdcfe762a52e30e09223f4128a5f4da530aefcf9 Mon Sep 17 00:00:00 2001
+From: Adam Gandelman <adamg at canonical.com>
+Date: Thu, 29 Sep 2011 21:06:06 -0700
+Subject: [PATCH 30/40] Ensure non-default FLAGS.logfile_mode is properly
+ converted to an octet.
+
+Fixes bug 862969.
+
+(cherry picked from commit 5b173ef5dfb7c41dbc2a4bb5c9976811516eb00f)
+
+Change-Id: Ic89426e2e011e74d49ca57710ade93dc4e4740d0
+---
+ nova/flags.py |    2 +-
+ nova/log.py   |    5 +++--
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/nova/flags.py b/nova/flags.py
+index 0a87148..55a56f2 100644
+--- a/nova/flags.py
++++ b/nova/flags.py
+@@ -349,7 +349,7 @@ DEFINE_string('lock_path', os.path.join(os.path.dirname(__file__), '../'),
+               'Directory for lock files')
+ DEFINE_string('logdir', None, 'output to a per-service log file in named '
+                               'directory')
+-DEFINE_integer('logfile_mode', 0644, 'Default file mode of the logs.')
++DEFINE_string('logfile_mode', '0644', 'Default file mode of the logs.')
+ DEFINE_string('sqlite_db', 'nova.sqlite', 'file name for sqlite')
+ DEFINE_string('sql_connection',
+               'sqlite:///$state_path/$sqlite_db',
+diff --git a/nova/log.py b/nova/log.py
+index eb0b602..1e04f75 100644
+--- a/nova/log.py
++++ b/nova/log.py
+@@ -259,9 +259,10 @@ class NovaRootLogger(NovaLogger):
+                 self.addHandler(self.filelog)
+                 self.logpath = logpath
+ 
++                mode = int(FLAGS.logfile_mode, 8)
+                 st = os.stat(self.logpath)
+-                if st.st_mode != (stat.S_IFREG | FLAGS.logfile_mode):
+-                    os.chmod(self.logpath, FLAGS.logfile_mode)
++                if st.st_mode != (stat.S_IFREG | mode):
++                    os.chmod(self.logpath, mode)
+         else:
+             self.removeHandler(self.filelog)
+             self.addHandler(self.streamlog)
+-- 
+1.7.6.4
+
diff --git a/0031-Explicit-errors-on-confirm-revertResize-failures.patch b/0031-Explicit-errors-on-confirm-revertResize-failures.patch
new file mode 100644
index 0000000..2057c35
--- /dev/null
+++ b/0031-Explicit-errors-on-confirm-revertResize-failures.patch
@@ -0,0 +1,88 @@
+From ec2bfe91b7bf7424eb34ad371ec25eec62cd3d24 Mon Sep 17 00:00:00 2001
+From: Brian Waldon <brian.waldon at rackspace.com>
+Date: Mon, 26 Sep 2011 13:57:34 -0400
+Subject: [PATCH 31/40] Explicit errors on confirm/revertResize failures
+
+Fixing bug 856527
+
+(cherry picked from commit 261b4111d481562760321bfc83d64ba35e981b5b)
+
+Change-Id: I3664875a3d7f0da5603bb23ca01b990ed08eed68
+---
+ nova/api/openstack/servers.py                   |    6 +++++
+ nova/tests/api/openstack/test_server_actions.py |   28 +++++++++++++++++++++++
+ 2 files changed, 34 insertions(+), 0 deletions(-)
+
+diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
+index fc14234..e32a6ff 100644
+--- a/nova/api/openstack/servers.py
++++ b/nova/api/openstack/servers.py
+@@ -305,6 +305,9 @@ class Controller(object):
+     def _action_confirm_resize(self, input_dict, req, id):
+         try:
+             self.compute_api.confirm_resize(req.environ['nova.context'], id)
++        except exception.MigrationNotFound:
++            msg = _("Instance has not been resized.")
++            raise exc.HTTPBadRequest(explanation=msg)
+         except Exception, e:
+             LOG.exception(_("Error in confirm-resize %s"), e)
+             raise exc.HTTPBadRequest()
+@@ -313,6 +316,9 @@ class Controller(object):
+     def _action_revert_resize(self, input_dict, req, id):
+         try:
+             self.compute_api.revert_resize(req.environ['nova.context'], id)
++        except exception.MigrationNotFound:
++            msg = _("Instance has not been resized.")
++            raise exc.HTTPBadRequest(explanation=msg)
+         except Exception, e:
+             LOG.exception(_("Error in revert-resize %s"), e)
+             raise exc.HTTPBadRequest()
+diff --git a/nova/tests/api/openstack/test_server_actions.py b/nova/tests/api/openstack/test_server_actions.py
+index 6a0feda..eb4ec05 100644
+--- a/nova/tests/api/openstack/test_server_actions.py
++++ b/nova/tests/api/openstack/test_server_actions.py
+@@ -271,6 +271,20 @@ class ServerActionsTest(test.TestCase):
+         res = req.get_response(fakes.wsgi_app())
+         self.assertEqual(res.status_int, 400)
+ 
++    def test_confirm_resize_migration_not_found(self):
++        req = self.webreq('/1/action', 'POST', dict(confirmResize=None))
++
++        def confirm_resize_mock(*args):
++            raise exception.MigrationNotFoundByStatus(instance_id=1,
++                                                      status='finished')
++
++        self.stubs.Set(nova.compute.api.API,
++                       'confirm_resize',
++                       confirm_resize_mock)
++
++        res = req.get_response(fakes.wsgi_app())
++        self.assertEqual(res.status_int, 400)
++
+     def test_revert_resize_server(self):
+         req = self.webreq('/1/action', 'POST', dict(revertResize=None))
+ 
+@@ -315,6 +329,20 @@ class ServerActionsTest(test.TestCase):
+         self.assertEqual(res.status_int, 202)
+         self.assertEqual(self.resize_called, True)
+ 
++    def test_revert_resize_migration_not_found(self):
++        req = self.webreq('/1/action', 'POST', dict(revertResize=None))
++
++        def revert_resize_mock(*args):
++            raise exception.MigrationNotFoundByStatus(instance_id=1,
++                                                      status='finished')
++
++        self.stubs.Set(nova.compute.api.API,
++                       'revert_resize',
++                       revert_resize_mock)
++
++        res = req.get_response(fakes.wsgi_app())
++        self.assertEqual(res.status_int, 400)
++
+     def test_create_backup(self):
+         """The happy path for creating backups"""
+         self.flags(allow_admin_api=True)
+-- 
+1.7.6.4
+
diff --git a/0032-Adds-ext4-and-reiserfs-to-_mount_filesystem.patch b/0032-Adds-ext4-and-reiserfs-to-_mount_filesystem.patch
new file mode 100644
index 0000000..28b5216
--- /dev/null
+++ b/0032-Adds-ext4-and-reiserfs-to-_mount_filesystem.patch
@@ -0,0 +1,30 @@
+From c206f73d03aa487868ba2acaa3581624160d1b67 Mon Sep 17 00:00:00 2001
+From: Josh Kearney <josh at jk0.org>
+Date: Thu, 20 Oct 2011 14:44:11 -0500
+Subject: [PATCH 32/40] Adds ext4 and reiserfs to _mount_filesystem().
+
+Fixes bug 870495.
+
+(cherry picked from commit 71f2b0dfac30537054376d583323f9912078788c)
+
+Change-Id: Ie19d5ecf5764eb93346fa773f6437c2370ad7a5b
+---
+ nova/virt/xenapi/vm_utils.py |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py
+index 302238c..2d82781 100644
+--- a/nova/virt/xenapi/vm_utils.py
++++ b/nova/virt/xenapi/vm_utils.py
+@@ -1161,7 +1161,7 @@ def _mount_filesystem(dev_path, dir):
+     """mounts the device specified by dev_path in dir"""
+     try:
+         out, err = utils.execute('mount',
+-                                 '-t', 'ext2,ext3',
++                                 '-t', 'ext2,ext3,ext4,reiserfs',
+                                  dev_path, dir, run_as_root=True)
+     except exception.ProcessExecutionError as e:
+         err = str(e)
+-- 
+1.7.6.4
+
diff --git a/0033-Improve-access-check-on-images.patch b/0033-Improve-access-check-on-images.patch
new file mode 100644
index 0000000..8770239
--- /dev/null
+++ b/0033-Improve-access-check-on-images.patch
@@ -0,0 +1,82 @@
+From c11659215a1cd3e551ce56f089b2682842954b04 Mon Sep 17 00:00:00 2001
+From: Loganathan Parthipan <parthipan at hp.com>
+Date: Thu, 29 Sep 2011 16:41:49 +0100
+Subject: [PATCH 33/40] Improve access check on images
+
+Makes sure that users can delete only their own images, snapshots.
+Enable listing of all images, both private which are owned and the public
+ones. Only list the private images/snapshots for the owner and admin users.
+Fixes bug 863305
+
+(cherry picked from commit cb37d895a6b97e294aa838f85227d29892f4e11e)
+
+Change-Id: Idc15125371950e0c07b1dac48e8b844887fefc9d
+---
+ Authors               |    1 +
+ nova/image/glance.py  |   20 +++++++++++++++++++-
+ nova/image/service.py |    3 +++
+ 3 files changed, 23 insertions(+), 1 deletions(-)
+
+diff --git a/Authors b/Authors
+index cc78535..2298120 100644
+--- a/Authors
++++ b/Authors
+@@ -74,6 +74,7 @@ Kevin Bringard <kbringard at attinteractive.com>
+ Kevin L. Mitchell <kevin.mitchell at rackspace.com>
+ Kirill Shileev <kshileev at gmail.com>
+ Koji Iida <iida.koji at lab.ntt.co.jp>
++Loganathan Parthipan <parthipan at hp.com>
+ Lorin Hochstein <lorin at isi.edu>
+ Lvov Maxim <usrleon at gmail.com>
+ Mandell Degerness <mdegerne at gmail.com>
+diff --git a/nova/image/glance.py b/nova/image/glance.py
+index 13c8ff8..5b6ec87 100644
+--- a/nova/image/glance.py
++++ b/nova/image/glance.py
+@@ -295,10 +295,28 @@ class GlanceImageService(service.BaseImageService):
+         """Delete the given image.
+ 
+         :raises: ImageNotFound if the image does not exist.
++        :raises: NotAuthorized if the user is not an owner.
+ 
+         """
+         # NOTE(vish): show is to check if image is available
+-        self.show(context, image_id)
++        image_meta = self.show(context, image_id)
++
++        if FLAGS.use_deprecated_auth:
++            # NOTE(parthi): only allow image deletions if the user
++            # is a member of the project owning the image, in case of
++            # setup without keystone
++            # TODO Currently this access control breaks if
++            # 1. Image is not owned by a project
++            # 2. Deleting user is not bound a project
++            properties = image_meta['properties']
++            if (context.project_id and ('project_id' in properties)
++                and (context.project_id != properties['project_id'])):
++                raise exception.NotAuthorized(_("Not the image owner"))
++
++            if (context.project_id and ('owner_id' in properties)
++                and (context.project_id != properties['owner_id'])):
++                raise exception.NotAuthorized(_("Not the image owner"))
++
+         try:
+             result = self._get_client(context).delete_image(image_id)
+         except glance_exception.NotFound:
+diff --git a/nova/image/service.py b/nova/image/service.py
+index 5361cfc..0198279 100644
+--- a/nova/image/service.py
++++ b/nova/image/service.py
+@@ -151,6 +151,9 @@ class BaseImageService(object):
+ 
+         properties = image_meta['properties']
+ 
++        if context.project_id and ('owner_id' in properties):
++            return str(properties['owner_id']) == str(context.project_id)
++
+         if context.project_id and ('project_id' in properties):
+             return str(properties['project_id']) == str(context.project_id)
+ 
+-- 
+1.7.6.4
+
diff --git a/0034-Fixes-bug-834633-Auto-assigning-floating-IPs.patch b/0034-Fixes-bug-834633-Auto-assigning-floating-IPs.patch
new file mode 100644
index 0000000..6adea18
--- /dev/null
+++ b/0034-Fixes-bug-834633-Auto-assigning-floating-IPs.patch
@@ -0,0 +1,62 @@
+From 80d73a2df2c33212217c59783f62d74673776ebb Mon Sep 17 00:00:00 2001
+From: Kiall Mac Innes <kiall at managedit.ie>
+Date: Fri, 4 Nov 2011 19:43:50 +0000
+Subject: [PATCH 34/40] Fixes bug 834633 - Auto assigning floating IPs
+
+Details:
+
+ - This fix is specific to the auto_assign_floating_ip=true feature, which was new in diablo[1] and looks like it never actually worked.
+ - Trey's refactoring on master[2] fixed bug #834633 where a FloatingIp object was passed to network_api.associate_floating_ip() instead of an address string.
+ - In bug #834633, Serguei Koubli had previously (i.e. before Trey's refactoring) proposed a much more isolated fix for this issue.
+ - This commit includes Serguei Koubli's fix, and, has also fixed a seperate issue where auto-assigned flating IPs could not be deallocated. (This fix was also included in Trey's refactoring)
+
+[1] https://blueprints.launchpad.net/nova/+spec/floating-ip-auto-assignment
+[2] https://review.openstack.org/628
+
+Change-Id: Ie439c6743f066f8504ef88de861dee8a7762940d
+---
+ Authors                 |    1 +
+ nova/network/manager.py |    8 +++++---
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/Authors b/Authors
+index 2298120..cadfb26 100644
+--- a/Authors
++++ b/Authors
+@@ -72,6 +72,7 @@ masumoto<masumotok at nttdata.co.jp>
+ Ken Pepple <ken.pepple at gmail.com>
+ Kevin Bringard <kbringard at attinteractive.com>
+ Kevin L. Mitchell <kevin.mitchell at rackspace.com>
++Kiall Mac Innes <kiall at managedit.ie>
+ Kirill Shileev <kshileev at gmail.com>
+ Koji Iida <iida.koji at lab.ntt.co.jp>
+ Loganathan Parthipan <parthipan at hp.com>
+diff --git a/nova/network/manager.py b/nova/network/manager.py
+index c582d4d..d8de396 100644
+--- a/nova/network/manager.py
++++ b/nova/network/manager.py
+@@ -234,8 +234,8 @@ class FloatingIP(object):
+ 
+             # call to correct network host to associate the floating ip
+             self.network_api.associate_floating_ip(context,
+-                                              floating_ip,
+-                                              fixed_ip,
++                                              floating_ip['address'],
++                                              fixed_ip['address'],
+                                               affect_auto_assigned=True)
+         return ips
+ 
+@@ -257,7 +257,9 @@ class FloatingIP(object):
+             # disassociate floating ips related to fixed_ip
+             for floating_ip in fixed_ip.floating_ips:
+                 address = floating_ip['address']
+-                self.network_api.disassociate_floating_ip(context, address)
++                self.network_api.disassociate_floating_ip(context,
++                                                          address,
++                                                          True)
+                 # deallocate if auto_assigned
+                 if floating_ip['auto_assigned']:
+                     self.network_api.release_floating_ip(context,
+-- 
+1.7.6.4
+
diff --git a/0035-fixes-bug-883233.patch b/0035-fixes-bug-883233.patch
new file mode 100644
index 0000000..fd76ff4
--- /dev/null
+++ b/0035-fixes-bug-883233.patch
@@ -0,0 +1,44 @@
+From 476c3259b1bb7cfe647aed4ac4a523d6fadff475 Mon Sep 17 00:00:00 2001
+From: Joe Gordon <jogo at cloudscaling.com>
+Date: Wed, 2 Nov 2011 16:21:21 -0700
+Subject: [PATCH 35/40] fixes bug 883233.
+
+fix typo in scheduler/driver.py assert_compute_node_has_enough_memory.
+
+(cherry picked from commit fbe692f9d727ff1f96b960794f637f26a85a61cb)
+
+Change-Id: Idce87927a35b5986c970e6293428b3a5fddd00e4
+---
+ Authors                  |    1 +
+ nova/scheduler/driver.py |    3 ++-
+ 2 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/Authors b/Authors
+index 2298120..e6ee68c 100644
+--- a/Authors
++++ b/Authors
+@@ -51,6 +51,7 @@ Jason Koelker <jason at koelker.net>
+ Jay Pipes <jaypipes at gmail.com>
+ Jesse Andrews <anotherjesse at gmail.com>
+ Jimmy Bergman <jimmy at sigint.se>
++Joe Gordon <jogo at cloudscaling.com>
+ Joe Heck <heckj at mac.com>
+ Joel Moore <joelbm24 at gmail.com>
+ Johannes Erdfelt <johannes.erdfelt at rackspace.com>
+diff --git a/nova/scheduler/driver.py b/nova/scheduler/driver.py
+index 22f4e14..43e1382 100644
+--- a/nova/scheduler/driver.py
++++ b/nova/scheduler/driver.py
+@@ -291,7 +291,8 @@ class Scheduler(object):
+         if avail <= mem_inst:
+             instance_id = ec2utils.id_to_ec2_id(instance_ref['id'])
+             reason = _("Unable to migrate %(instance_id)s to %(dest)s: "
+-                       "Lack of disk(host:%(avail)s <= instance:%(mem_inst)s)")
++                       "Lack of memory(host:%(avail)s <= "
++                       "instance:%(mem_inst)s)")
+             raise exception.MigrationError(reason=reason % locals())
+ 
+     def assert_compute_node_has_enough_disk(self, context,
+-- 
+1.7.6.4
+
diff --git a/0004-Add-INPUT-chain-rule-for-EC2-metadata-requests-lp-85.patch b/0036-Add-INPUT-chain-rule-for-EC2-metadata-requests-lp-85.patch
similarity index 85%
rename from 0004-Add-INPUT-chain-rule-for-EC2-metadata-requests-lp-85.patch
rename to 0036-Add-INPUT-chain-rule-for-EC2-metadata-requests-lp-85.patch
index d95aa40..fb0b12e 100644
--- a/0004-Add-INPUT-chain-rule-for-EC2-metadata-requests-lp-85.patch
+++ b/0036-Add-INPUT-chain-rule-for-EC2-metadata-requests-lp-85.patch
@@ -1,7 +1,8 @@
-From 8666ba16b84efa4ef7d393faaecbfcd8d5e3015a Mon Sep 17 00:00:00 2001
+From b434509c19376d67e7cbf358661cbfdb2ea934f9 Mon Sep 17 00:00:00 2001
 From: Mark McLoughlin <markmc at redhat.com>
 Date: Mon, 5 Sep 2011 07:10:52 +0100
-Subject: [PATCH] Add INPUT chain rule for EC2 metadata requests (lp:856385)
+Subject: [PATCH 36/40] Add INPUT chain rule for EC2 metadata requests
+ (lp:856385)
 
 On Fedora, the default policy for the INPUT chain in the filter table
 is DROP. This means that EC2 metadata requests from guests get dropped.
@@ -21,10 +22,10 @@ Change-Id: Ic99ba9249ce5219cd2631184154add82d25d9d6d
  1 files changed, 4 insertions(+), 0 deletions(-)
 
 diff --git a/nova/network/linux_net.py b/nova/network/linux_net.py
-index ac52c16..0482d4e 100755
+index c0be962..fd51e9b 100755
 --- a/nova/network/linux_net.py
 +++ b/nova/network/linux_net.py
-@@ -381,6 +381,10 @@ def metadata_forward():
+@@ -378,6 +378,10 @@ def metadata_forward():
                                            '-p tcp -m tcp --dport 80 -j DNAT '
                                            '--to-destination %s:%s' % \
                                            (FLAGS.ec2_dmz_host, FLAGS.ec2_port))
diff --git a/0005-Have-nova-api-add-the-INPUT-rule-for-EC2-metadata-lp.patch b/0037-Have-nova-api-add-the-INPUT-rule-for-EC2-metadata-lp.patch
similarity index 96%
rename from 0005-Have-nova-api-add-the-INPUT-rule-for-EC2-metadata-lp.patch
rename to 0037-Have-nova-api-add-the-INPUT-rule-for-EC2-metadata-lp.patch
index 05eb493..e357047 100644
--- a/0005-Have-nova-api-add-the-INPUT-rule-for-EC2-metadata-lp.patch
+++ b/0037-Have-nova-api-add-the-INPUT-rule-for-EC2-metadata-lp.patch
@@ -1,7 +1,7 @@
-From 491261a15148092fce67feb8bb484e2d8a9d2a75 Mon Sep 17 00:00:00 2001
+From 514d3518edd4d74623bf3a529683b2b59212e390 Mon Sep 17 00:00:00 2001
 From: Mark McLoughlin <markmc at redhat.com>
 Date: Thu, 8 Sep 2011 14:29:49 +0100
-Subject: [PATCH] Have nova-api add the INPUT rule for EC2 metadata
+Subject: [PATCH 37/40] Have nova-api add the INPUT rule for EC2 metadata
  (lp:856385)
 
 It makes no sense to have nova-network add an iptables rule for the EC2
@@ -70,7 +70,7 @@ index 0000000..b3fcf93
 +        """
 +        self.network_driver.metadata_accept()
 diff --git a/nova/flags.py b/nova/flags.py
-index 0a87148..432d483 100644
+index 55a56f2..56bc797 100644
 --- a/nova/flags.py
 +++ b/nova/flags.py
 @@ -413,6 +413,9 @@ DEFINE_bool('resume_guests_state_on_host_boot', False,
@@ -84,10 +84,10 @@ index 0a87148..432d483 100644
  
  DEFINE_bool('monkey_patch', False,
 diff --git a/nova/network/linux_net.py b/nova/network/linux_net.py
-index 0482d4e..f1e9adf 100755
+index fd51e9b..297146b 100755
 --- a/nova/network/linux_net.py
 +++ b/nova/network/linux_net.py
-@@ -381,10 +381,17 @@ def metadata_forward():
+@@ -378,10 +378,17 @@ def metadata_forward():
                                            '-p tcp -m tcp --dport 80 -j DNAT '
                                            '--to-destination %s:%s' % \
                                            (FLAGS.ec2_dmz_host, FLAGS.ec2_port))
@@ -108,7 +108,7 @@ index 0482d4e..f1e9adf 100755
  
  
 diff --git a/nova/network/manager.py b/nova/network/manager.py
-index 5c2bc60..90b47b9 100644
+index d8de396..71e171c 100644
 --- a/nova/network/manager.py
 +++ b/nova/network/manager.py
 @@ -96,8 +96,6 @@ flags.DEFINE_string('fixed_range_v6', 'fd00::/48', 'Fixed IPv6 address block')
diff --git a/0006-Allow-the-user-to-choose-either-ietadm-or-tgtadm-lp-.patch b/0038-Allow-the-user-to-choose-either-ietadm-or-tgtadm-lp-.patch
similarity index 98%
rename from 0006-Allow-the-user-to-choose-either-ietadm-or-tgtadm-lp-.patch
rename to 0038-Allow-the-user-to-choose-either-ietadm-or-tgtadm-lp-.patch
index 37a0651..892e9d7 100644
--- a/0006-Allow-the-user-to-choose-either-ietadm-or-tgtadm-lp-.patch
+++ b/0038-Allow-the-user-to-choose-either-ietadm-or-tgtadm-lp-.patch
@@ -1,7 +1,8 @@
-From ed1aff808be28ed79773ed269b0096c4a48464ef Mon Sep 17 00:00:00 2001
+From 55e01ff6f84a201fecd1e550c8fad592a6edd567 Mon Sep 17 00:00:00 2001
 From: Mark McLoughlin <markmc at redhat.com>
 Date: Thu, 11 Aug 2011 07:44:38 -0400
-Subject: [PATCH] Allow the user to choose either ietadm or tgtadm (lp:819997)
+Subject: [PATCH 38/40] Allow the user to choose either ietadm or tgtadm
+ (lp:819997)
 
 (Actually authored by Chuck Short <zulcss at ubuntu.com> but Gerrit won't
 allow me to push it with Author: set to that)
@@ -14,7 +15,7 @@ Change-Id: Ia350345a25a5f39b8aa26c8daf2a9987590d4b62
  3 files changed, 111 insertions(+), 34 deletions(-)
 
 diff --git a/nova/flags.py b/nova/flags.py
-index 432d483..4c71dd3 100644
+index 56bc797..7e59ddc 100644
 --- a/nova/flags.py
 +++ b/nova/flags.py
 @@ -416,6 +416,9 @@ DEFINE_string('root_helper', 'sudo',
diff --git a/0007-Remove-VolumeDriver.sync_exec-method-lp-819997.patch b/0039-Remove-VolumeDriver.sync_exec-method-lp-819997.patch
similarity index 98%
rename from 0007-Remove-VolumeDriver.sync_exec-method-lp-819997.patch
rename to 0039-Remove-VolumeDriver.sync_exec-method-lp-819997.patch
index 2a27c0a..8cd49b5 100644
--- a/0007-Remove-VolumeDriver.sync_exec-method-lp-819997.patch
+++ b/0039-Remove-VolumeDriver.sync_exec-method-lp-819997.patch
@@ -1,7 +1,7 @@
-From ee5eacc0e268dc72d00f21685197f2fc734fc738 Mon Sep 17 00:00:00 2001
+From b82462cc4fd598cde59c663400e87824cb68a34b Mon Sep 17 00:00:00 2001
 From: Mark McLoughlin <markmc at redhat.com>
 Date: Sun, 18 Sep 2011 12:04:46 +0100
-Subject: [PATCH] Remove VolumeDriver.sync_exec method (lp:819997)
+Subject: [PATCH 39/40] Remove VolumeDriver.sync_exec method (lp:819997)
 
 We always use the same functions for sync_exec and execute.
 
diff --git a/0008-Refactor-ietadm-tgtadm-calls-out-into-helper-classes.patch b/0040-Refactor-ietadm-tgtadm-calls-out-into-helper-classes.patch
similarity index 99%
rename from 0008-Refactor-ietadm-tgtadm-calls-out-into-helper-classes.patch
rename to 0040-Refactor-ietadm-tgtadm-calls-out-into-helper-classes.patch
index 1c42329..9e822f7 100644
--- a/0008-Refactor-ietadm-tgtadm-calls-out-into-helper-classes.patch
+++ b/0040-Refactor-ietadm-tgtadm-calls-out-into-helper-classes.patch
@@ -1,7 +1,7 @@
-From c82a027f2993965f5d14be048ce8c4b56a76b468 Mon Sep 17 00:00:00 2001
+From fa75aca613a531a39e4a30a064e5d549ba26b7ac Mon Sep 17 00:00:00 2001
 From: Mark McLoughlin <markmc at redhat.com>
 Date: Sun, 18 Sep 2011 16:02:43 +0100
-Subject: [PATCH] Refactor ietadm/tgtadm calls out into helper classes
+Subject: [PATCH 40/40] Refactor ietadm/tgtadm calls out into helper classes
  (lp:819997)
 
 Add a new TargetAdmin abstract base class and implement it using ietadm
@@ -19,7 +19,7 @@ Change-Id: I1c0064e5d35483a6c4059cfc61a484f5f576b2da
  create mode 100644 nova/volume/iscsi.py
 
 diff --git a/nova/flags.py b/nova/flags.py
-index 4c71dd3..432d483 100644
+index 7e59ddc..56bc797 100644
 --- a/nova/flags.py
 +++ b/nova/flags.py
 @@ -416,9 +416,6 @@ DEFINE_string('root_helper', 'sudo',
diff --git a/openstack-nova.spec b/openstack-nova.spec
index 58c91f2..cf20fbb 100644
--- a/openstack-nova.spec
+++ b/openstack-nova.spec
@@ -2,7 +2,7 @@
 
 Name:             openstack-nova
 Version:          2011.3
-Release:          6%{?dist}
+Release:          7%{?dist}
 Summary:          OpenStack Compute (nova)
 
 Group:            Applications/System
@@ -29,16 +29,50 @@ Source22:         nova-ifc-template
 #
 # Patches managed here: https://github.com/markmc/nova/tree/fedora-patches
 #
-Patch1:           0001-Removed-db_pool-complexities-from-nova.db.sqlalchemy.patch
-Patch2:           0002-Makes-sure-to-recreate-gateway-for-moved-ip.patch
-Patch3:           0003-Fix-the-grantee-group-loading-for-source-groups.patch
-Patch4:           0004-Add-INPUT-chain-rule-for-EC2-metadata-requests-lp-85.patch
-Patch5:           0005-Have-nova-api-add-the-INPUT-rule-for-EC2-metadata-lp.patch
-Patch6:           0006-Allow-the-user-to-choose-either-ietadm-or-tgtadm-lp-.patch
-Patch7:           0007-Remove-VolumeDriver.sync_exec-method-lp-819997.patch
-Patch8:           0008-Refactor-ietadm-tgtadm-calls-out-into-helper-classes.patch
-Patch9:           0009-Fixed-bug-lp850602.patch
-Patch10:          0010-Stop-returning-correct-password-on-api-calls.patch
+#   $> git format-patch b0e855e
+#   $> for p in 00*.patch; do echo "Patch${p:2:2}:          $p"; done
+#   $> for p in 00*.patch; do echo "%patch${p:2:2} -p1"; done
+#
+Patch01:          0001-Add-tools-rfc.sh-from-master.patch
+Patch02:          0002-Don-t-use-GitPython-for-authors-check.patch
+Patch03:          0003-Made-jenkins-email-pruning-more-resilient.patch
+Patch04:          0004-Removing-old-code-that-snuck-back-in.patch
+Patch05:          0005-Fix-outstanding-pep8-errors-for-a-clean-trunk.patch
+Patch06:          0006-Point-tools-rfc.sh-at-the-right-branch.patch
+Patch07:          0007-Makes-sure-to-recreate-gateway-for-moved-ip.patch
+Patch08:          0008-put-fully-qualified-domain-name-in-local-hostname.patch
+Patch09:          0009-Fix-the-grantee-group-loading-for-source-groups.patch
+Patch10:          0010-Call-endheaders-when-auth_token-is-None.-Fixes-bug-8.patch
+Patch11:          0011-Removed-db_pool-complexities-from-nova.db.sqlalchemy.patch
+Patch12:          0012-Raise-InsufficientFreeMemory.patch
+Patch13:          0013-Don-t-leak-exceptions-out-to-users.patch
+Patch14:          0014-Makes-snapshots-work-for-amis.-Fixes-bug-873156.patch
+Patch15:          0015-Add-missing-author.patch
+Patch16:          0016-Make-snapshots-private-by-default.patch
+Patch17:          0017-Snapshots-backups-can-no-longer-happen-simultaneousl.patch
+Patch18:          0018-Fixed-bug-lp850602.patch
+Patch19:          0019-bug-861310.patch
+Patch20:          0020-Enforce-snapshot-cleanup.patch
+Patch21:          0021-bug-lp845714.patch
+Patch22:          0022-Added-1.0.4-version-specifier-to-kombu-in-pip-requir.patch
+Patch23:          0023-Adds-the-tenant-id-to-the-create-images-response-Loc.patch
+Patch24:          0024-Fixes-bug-862633-OS-api-consoles-create-broken.patch
+Patch25:          0025-Deallocate-ip-if-build-fails.patch
+Patch26:          0026-Stop-returning-correct-password-on-api-calls.patch
+Patch27:          0027-Handle-pidfile-exception-for-dnsmasq.patch
+Patch28:          0028-Make-sure-unknown-extensions-return-404.patch
+Patch29:          0029-Include-original-exception-in-ClassNotFound-exceptio.patch
+Patch30:          0030-Ensure-non-default-FLAGS.logfile_mode-is-properly-co.patch
+Patch31:          0031-Explicit-errors-on-confirm-revertResize-failures.patch
+Patch32:          0032-Adds-ext4-and-reiserfs-to-_mount_filesystem.patch
+Patch33:          0033-Improve-access-check-on-images.patch
+Patch34:          0034-Fixes-bug-834633-Auto-assigning-floating-IPs.patch
+Patch35:          0035-fixes-bug-883233.patch
+Patch36:          0036-Add-INPUT-chain-rule-for-EC2-metadata-requests-lp-85.patch
+Patch37:          0037-Have-nova-api-add-the-INPUT-rule-for-EC2-metadata-lp.patch
+Patch38:          0038-Allow-the-user-to-choose-either-ietadm-or-tgtadm-lp-.patch
+Patch39:          0039-Remove-VolumeDriver.sync_exec-method-lp-819997.patch
+Patch40:          0040-Refactor-ietadm-tgtadm-calls-out-into-helper-classes.patch
 
 BuildArch:        noarch
 BuildRequires:    intltool
@@ -166,16 +200,50 @@ This package contains documentation files for nova.
 %prep
 %setup -q -n nova-%{version}
 
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
-%patch6 -p1
-%patch7 -p1
-%patch8 -p1
-%patch9 -p1
+# Replicate screwup during git->bzr switch
+%patch04 -p1 -R
+
+# Now apply the patches from git
+%patch01 -p1
+%patch02 -p1
+%patch03 -p1
+%patch04 -p1
+%patch05 -p1
+%patch06 -p1
+%patch07 -p1
+%patch08 -p1
+%patch09 -p1
 %patch10 -p1
+%patch11 -p1
+%patch12 -p1
+%patch13 -p1
+%patch14 -p1
+%patch15 -p1
+%patch16 -p1
+%patch17 -p1
+%patch18 -p1
+%patch19 -p1
+%patch20 -p1
+%patch21 -p1
+%patch22 -p1
+%patch23 -p1
+%patch24 -p1
+%patch25 -p1
+%patch26 -p1
+%patch27 -p1
+%patch28 -p1
+%patch29 -p1
+%patch30 -p1
+%patch31 -p1
+%patch32 -p1
+%patch33 -p1
+%patch34 -p1
+%patch35 -p1
+%patch36 -p1
+%patch37 -p1
+%patch38 -p1
+%patch39 -p1
+%patch40 -p1
 
 find . \( -name .gitignore -o -name .placeholder \) -delete
 
@@ -363,6 +431,9 @@ fi
 %endif
 
 %changelog
+* Mon Nov 14 2011 Mark McLoughlin <markmc at redhat.com> - 2011.3-7
+- Add ~20 significant fixes from upstream stable branch
+
 * Wed Oct 26 2011 Mark McLoughlin <markmc at redhat.com> - 2011.3-6
 - Fix password leak in EC2 API (#749385, CVE 2011-4076)
 


More information about the scm-commits mailing list