[openstack-nova] update to Essex release

Pádraig Brady pbrady at fedoraproject.org
Sun Apr 8 02:18:23 UTC 2012


commit dc6afc034baeb6ad1ec6e1ce0eb6d9f972eff8bb
Author: Pádraig Brady <P at draigBrady.com>
Date:   Sun Apr 8 02:46:21 2012 +0100

    update to Essex release

 .gitignore                                         |    1 +
 ...here-nova-ignores-glance-host-in-imageref.patch |   48 +++++++++++
 ...-libvirt-test-from-deleting-instances-dir.patch |   66 +++++++++++++++
 ...tomic-manipulation-of-libvirt-disk-images.patch |   36 ++++----
 ...d-validation-for-OSAPI-server-name-length.patch |   88 --------------------
 0004-Fixed-bug-962840-added-a-test-case.patch      |   75 +++++++++++++++++
 ...e-don-t-access-the-net-when-building-docs.patch |    2 +-
 ...0006-fix-useexisting-deprecation-warnings.patch |    2 +-
 openstack-nova.spec                                |   22 +++--
 sources                                            |    2 +-
 10 files changed, 224 insertions(+), 118 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 95745a4..a36abb7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@
 /nova-2012.1~e3.tar.gz
 /nova-2012.1~e4.tar.gz
 /nova-2012.1~rc1.tar.gz
+/nova-2012.1.tar.gz
diff --git a/0001-fix-bug-where-nova-ignores-glance-host-in-imageref.patch b/0001-fix-bug-where-nova-ignores-glance-host-in-imageref.patch
new file mode 100644
index 0000000..f5ff810
--- /dev/null
+++ b/0001-fix-bug-where-nova-ignores-glance-host-in-imageref.patch
@@ -0,0 +1,48 @@
+From 59c4ef7d2fc30b42b0c8fcf4a118409772cbf336 Mon Sep 17 00:00:00 2001
+From: Mike Lundy <mike at pistoncloud.com>
+Date: Wed, 4 Apr 2012 11:38:54 -0700
+Subject: [PATCH] fix bug where nova ignores glance host in imageref
+
+This is related to bug 883328.
+
+Change-Id: Iadd1aec8d1bda3bd75bd0ab7f6797b643626db90
+---
+ nova/image/glance.py            |    8 ++++----
+ nova/tests/image/test_glance.py |    3 ++-
+ 2 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/nova/image/glance.py b/nova/image/glance.py
+index a5f9e68..97a60cb 100644
+--- a/nova/image/glance.py
++++ b/nova/image/glance.py
+@@ -111,13 +111,13 @@ def get_glance_client(context, image_href):
+ 
+     else:
+         try:
+-            (image_id, host, port) = _parse_image_ref(image_href)
++            (image_id, glance_host, glance_port) = _parse_image_ref(image_href)
++            glance_client = _create_glance_client(context,
++                                                  glance_host,
++                                                  glance_port)
+         except ValueError:
+             raise exception.InvalidImageRef(image_href=image_href)
+ 
+-        glance_client = _create_glance_client(context,
+-                                              glance_host,
+-                                              glance_port)
+         return (glance_client, image_id)
+ 
+ 
+diff --git a/nova/tests/image/test_glance.py b/nova/tests/image/test_glance.py
+index bc5969a..8fa136a 100644
+--- a/nova/tests/image/test_glance.py
++++ b/nova/tests/image/test_glance.py
+@@ -578,6 +578,7 @@ class TestGlanceImageService(test.TestCase):
+     def test_glance_client_image_ref(self):
+         fixture = self._make_fixture(name='test image')
+         image_id = self.service.create(self.context, fixture)['id']
+-        image_url = 'http://foo/%s' % image_id
++        image_url = 'http://something-less-likely/%s' % image_id
+         client, same_id = glance.get_glance_client(self.context, image_url)
+         self.assertEquals(same_id, image_id)
++        self.assertEquals(client.host, 'something-less-likely')
diff --git a/0002-Stop-libvirt-test-from-deleting-instances-dir.patch b/0002-Stop-libvirt-test-from-deleting-instances-dir.patch
new file mode 100644
index 0000000..e9eeabf
--- /dev/null
+++ b/0002-Stop-libvirt-test-from-deleting-instances-dir.patch
@@ -0,0 +1,66 @@
+From b11b54b6afa5ff1091e59155971abf8bfb9df6cb Mon Sep 17 00:00:00 2001
+From: Vishvananda Ishaya <vishvananda at gmail.com>
+Date: Thu, 5 Apr 2012 17:00:25 -0700
+Subject: [PATCH] Stop libvirt test from deleting instances dir
+
+ * fixes bug 974293
+
+Change-Id: Id41ab20193a70246ad2e3e1cc18edf47059d312d
+---
+ nova/tests/test_libvirt.py |   37 ++++++++++++-------------------------
+ 1 files changed, 12 insertions(+), 25 deletions(-)
+
+diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py
+index 6b0f668..4ce91cb 100644
+--- a/nova/tests/test_libvirt.py
++++ b/nova/tests/test_libvirt.py
+@@ -2148,25 +2148,8 @@ class LibvirtConnectionTestCase(test.TestCase):
+     """Test for nova.virt.libvirt.connection.LibvirtConnection."""
+     def setUp(self):
+         super(LibvirtConnectionTestCase, self).setUp()
+-
+         self.libvirtconnection = connection.LibvirtConnection(read_only=True)
+ 
+-        self.temp_path = os.path.join(flags.FLAGS.instances_path,
+-                                      'instance-00000001/', '')
+-        try:
+-            os.makedirs(self.temp_path)
+-        except Exception:
+-            print 'testcase init error'
+-            pass
+-
+-    def tearDown(self):
+-        super(LibvirtConnectionTestCase, self).tearDown()
+-
+-        try:
+-            shutil.rmtree(flags.FLAGS.instances_path)
+-        except Exception:
+-            pass
+-
+     def _create_instance(self, params=None):
+         """Create a test instance"""
+         if not params:
+@@ -2374,11 +2357,15 @@ class LibvirtConnectionTestCase(test.TestCase):
+         self.stubs.Set(self.libvirtconnection, '_create_new_domain',
+                        fake_create_new_domain)
+ 
+-        ins_ref = self._create_instance()
+-        libvirt_xml_path = os.path.join(flags.FLAGS.instances_path,
+-                                        ins_ref['name'], 'libvirt.xml')
+-        f = open(libvirt_xml_path, 'w')
+-        f.close()
+-
+-        ref = self.libvirtconnection.finish_revert_migration(ins_ref, None)
+-        self.assertTrue(isinstance(ref, eventlet.event.Event))
++        with utils.tempdir() as tmpdir:
++            self.flags(instances_path=tmpdir)
++            ins_ref = self._create_instance()
++            os.mkdir(os.path.join(tmpdir, ins_ref['name']))
++            libvirt_xml_path = os.path.join(tmpdir,
++                                            ins_ref['name'],
++                                            'libvirt.xml')
++            f = open(libvirt_xml_path, 'w')
++            f.close()
++
++            ref = self.libvirtconnection.finish_revert_migration(ins_ref, None)
++            self.assertTrue(isinstance(ref, eventlet.event.Event))
diff --git a/0003-ensure-atomic-manipulation-of-libvirt-disk-images.patch b/0003-ensure-atomic-manipulation-of-libvirt-disk-images.patch
index 14046bd..2eae6fa 100644
--- a/0003-ensure-atomic-manipulation-of-libvirt-disk-images.patch
+++ b/0003-ensure-atomic-manipulation-of-libvirt-disk-images.patch
@@ -1,4 +1,4 @@
-From 0ce9eb5dabd84f7566d54ad5c16b807d73c9274d Mon Sep 17 00:00:00 2001
+From 3e4b550eca091904f73f3dd4602f40e7fe3ae888 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?P=C3=A1draig=20Brady?= <pbrady at redhat.com>
 Date: Fri, 16 Mar 2012 03:43:49 +0000
 Subject: [PATCH] ensure atomic manipulation of libvirt disk images
@@ -10,7 +10,7 @@ anywhere in the path from glance, through the libvirt image cache.
 These could cause subsequent operational errors either
 directly or indirectly through disk wastage.
 
-* nova/utils.py: Add a new remove_on_error() context manager
+* nova/utils.py: Add a new remove_path_on_error() context manager
 that is used to remove the passed PATH on a raised exception.
 * nova/virt/images.py: Ensure temporary downloaded and
 converted images are protected.
@@ -25,7 +25,7 @@ Change-Id: I81a5407665a6998128c0dee41387ef00ebddeb4d
  3 files changed, 57 insertions(+), 49 deletions(-)
 
 diff --git a/nova/utils.py b/nova/utils.py
-index ef2b329..6b3ca10 100644
+index 819929a..7188d98 100644
 --- a/nova/utils.py
 +++ b/nova/utils.py
 @@ -21,6 +21,7 @@
@@ -58,12 +58,12 @@ index ef2b329..6b3ca10 100644
              return
          else:
              raise
-@@ -1340,6 +1341,18 @@ def logging_error(message):
+@@ -1344,6 +1345,18 @@ def logging_error(message):
              LOG.exception(message)
  
  
 + at contextlib.contextmanager
-+def remove_on_error(path):
++def remove_path_on_error(path):
 +    """Protect code that wants to operate on PATH atomically.
 +    Any exception will cause PATH to be removed.
 +    """
@@ -78,7 +78,7 @@ index ef2b329..6b3ca10 100644
      """Return a path to a particular device.
  
 diff --git a/nova/virt/images.py b/nova/virt/images.py
-index 1e0ae0a..2c0b12c 100644
+index 1e0ae0a..626f3ff 100644
 --- a/nova/virt/images.py
 +++ b/nova/virt/images.py
 @@ -51,18 +51,10 @@ def fetch(context, image_href, path, _user_id, _project_id):
@@ -86,7 +86,7 @@ index 1e0ae0a..2c0b12c 100644
      (image_service, image_id) = nova.image.get_image_service(context,
                                                               image_href)
 -    try:
-+    with utils.remove_on_error(path):
++    with utils.remove_path_on_error(path):
          with open(path, "wb") as image_file:
              metadata = image_service.get(context, image_id, image_file)
 -    except Exception:
@@ -130,7 +130,7 @@ index 1e0ae0a..2c0b12c 100644
 -        data = _qemu_img_info(staged)
 -        if data.get('file format', None) != "raw":
 -            os.unlink(staged)
-+    with utils.remove_on_error(path_tmp):
++    with utils.remove_path_on_error(path_tmp):
 +        data = _qemu_img_info(path_tmp)
 +
 +        fmt = data.get("file format")
@@ -149,7 +149,7 @@ index 1e0ae0a..2c0b12c 100644
 +        if fmt != "raw" and FLAGS.force_raw_images:
 +            staged = "%s.converted" % path
 +            LOG.debug("%s was %s, converting to raw" % (image_href, fmt))
-+            with utils.remove_on_error(staged):
++            with utils.remove_path_on_error(staged):
 +                out, err = utils.execute('qemu-img', 'convert', '-O', 'raw',
 +                                         path_tmp, staged)
 +
@@ -169,48 +169,48 @@ index 1e0ae0a..2c0b12c 100644
  
      return metadata
 diff --git a/nova/virt/libvirt/connection.py b/nova/virt/libvirt/connection.py
-index 3aabfde..ea94e1e 100644
+index 5379eac..0c78453 100644
 --- a/nova/virt/libvirt/connection.py
 +++ b/nova/virt/libvirt/connection.py
-@@ -1028,7 +1028,8 @@ class LibvirtConnection(driver.ComputeDriver):
+@@ -1076,7 +1076,8 @@ class LibvirtConnection(driver.ComputeDriver):
              @utils.synchronized(fname)
              def call_if_not_exists(base, fn, *args, **kwargs):
                  if not os.path.exists(base):
 -                    fn(target=base, *args, **kwargs)
-+                    with utils.remove_on_error(base):
++                    with utils.remove_path_on_error(base):
 +                        fn(target=base, *args, **kwargs)
  
              if cow or not generating:
                  call_if_not_exists(base, fn, *args, **kwargs)
-@@ -1044,8 +1045,9 @@ class LibvirtConnection(driver.ComputeDriver):
+@@ -1092,8 +1093,9 @@ class LibvirtConnection(driver.ComputeDriver):
                          size_gb = size / (1024 * 1024 * 1024)
                          cow_base += "_%d" % size_gb
                          if not os.path.exists(cow_base):
 -                            libvirt_utils.copy_image(base, cow_base)
 -                            disk.extend(cow_base, size)
-+                            with utils.remove_on_error(cow_base):
++                            with utils.remove_path_on_error(cow_base):
 +                                libvirt_utils.copy_image(base, cow_base)
 +                                disk.extend(cow_base, size)
                      libvirt_utils.create_cow_image(cow_base, target)
                  elif not generating:
                      libvirt_utils.copy_image(base, target)
-@@ -1055,7 +1057,8 @@ class LibvirtConnection(driver.ComputeDriver):
+@@ -1103,7 +1105,8 @@ class LibvirtConnection(driver.ComputeDriver):
                      if size:
                          disk.extend(target, size)
  
 -            copy_and_extend(cow, generating, base, target, size)
-+            with utils.remove_on_error(target):
++            with utils.remove_path_on_error(target):
 +                copy_and_extend(cow, generating, base, target, size)
  
      @staticmethod
      def _create_local(target, local_size, unit='G',
-@@ -1215,8 +1218,9 @@ class LibvirtConnection(driver.ComputeDriver):
+@@ -1273,8 +1276,9 @@ class LibvirtConnection(driver.ComputeDriver):
                                project_id=instance['project_id'],)
          elif config_drive:
              label = 'config'
 -            self._create_local(basepath('disk.config'), 64, unit='M',
 -                               fs_format='msdos', label=label)  # 64MB
-+            with utils.remove_on_error(basepath('disk.config')):
++            with utils.remove_path_on_error(basepath('disk.config')):
 +                self._create_local(basepath('disk.config'), 64, unit='M',
 +                                   fs_format='msdos', label=label)  # 64MB
  
diff --git a/0004-Fixed-bug-962840-added-a-test-case.patch b/0004-Fixed-bug-962840-added-a-test-case.patch
new file mode 100644
index 0000000..c5e2690
--- /dev/null
+++ b/0004-Fixed-bug-962840-added-a-test-case.patch
@@ -0,0 +1,75 @@
+From 9653d687f4a388273964c610a6c8cbb34052f7c7 Mon Sep 17 00:00:00 2001
+From: Yun Mao <yunmao at gmail.com>
+Date: Tue, 3 Apr 2012 11:17:50 -0400
+Subject: [PATCH] Fixed bug 962840, added a test case.
+
+eventlet.tpool.Proxy doesn't work with old-style class in __str__()
+or __repr__() calls. See bug #962840 for details.
+We perform a monkey patch to replace those two instance methods.
+
+Change-Id: Ia51bbd3e71cad7df45da5b3b27eef70f9d9e9002
+
+Conflicts:
+
+	nova/tests/test_libvirt.py
+---
+ nova/tests/test_libvirt.py      |   19 +++++++++++++++++++
+ nova/virt/libvirt/connection.py |   18 ++++++++++++++++++
+ 2 files changed, 37 insertions(+), 0 deletions(-)
+
+diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py
+index 4ce91cb..5a476a4 100644
+--- a/nova/tests/test_libvirt.py
++++ b/nova/tests/test_libvirt.py
+@@ -2369,3 +2369,22 @@ class LibvirtConnectionTestCase(test.TestCase):
+ 
+             ref = self.libvirtconnection.finish_revert_migration(ins_ref, None)
+             self.assertTrue(isinstance(ref, eventlet.event.Event))
++
++
++class LibvirtNonblockingTestCase(test.TestCase):
++    """Test libvirt_nonblocking option"""
++
++    def setUp(self):
++        super(LibvirtNonblockingTestCase, self).setUp()
++        self.flags(libvirt_nonblocking=True, libvirt_uri="test:///default")
++
++    def tearDown(self):
++        super(LibvirtNonblockingTestCase, self).tearDown()
++
++    @test.skip_if(missing_libvirt(), "Test requires libvirt")
++    def test_connection_to_primitive(self):
++        """Test bug 962840"""
++        import nova.virt.libvirt.connection
++        connection = nova.virt.libvirt.connection.get_connection('')
++        utils.to_primitive(connection._conn, convert_instances=True)
++>>>>>>> bc173ec... Fixed bug 962840, added a test case.
+diff --git a/nova/virt/libvirt/connection.py b/nova/virt/libvirt/connection.py
+index 0c78453..2ade19a 100644
+--- a/nova/virt/libvirt/connection.py
++++ b/nova/virt/libvirt/connection.py
+@@ -170,6 +170,24 @@ flags.DECLARE('live_migration_retry_count', 'nova.compute.manager')
+ flags.DECLARE('vncserver_proxyclient_address', 'nova.vnc')
+ 
+ 
++def patch_tpool_proxy():
++    """eventlet.tpool.Proxy doesn't work with old-style class in __str__()
++    or __repr__() calls. See bug #962840 for details.
++    We perform a monkey patch to replace those two instance methods.
++    """
++    def str_method(self):
++        return str(self._obj)
++
++    def repr_method(self):
++        return repr(self._obj)
++
++    tpool.Proxy.__str__ = str_method
++    tpool.Proxy.__repr__ = repr_method
++
++
++patch_tpool_proxy()
++
++
+ def get_connection(read_only):
+     # These are loaded late so that there's no need to install these
+     # libraries when not using libvirt.
diff --git a/0001-Ensure-we-don-t-access-the-net-when-building-docs.patch b/0005-Ensure-we-don-t-access-the-net-when-building-docs.patch
similarity index 94%
rename from 0001-Ensure-we-don-t-access-the-net-when-building-docs.patch
rename to 0005-Ensure-we-don-t-access-the-net-when-building-docs.patch
index e1cb7e9..112b86f 100644
--- a/0001-Ensure-we-don-t-access-the-net-when-building-docs.patch
+++ b/0005-Ensure-we-don-t-access-the-net-when-building-docs.patch
@@ -1,4 +1,4 @@
-From 77af841f5a2e249b4ede21f393b5464b8b750226 Mon Sep 17 00:00:00 2001
+From 013d88f18b4482cff75779da4fae0bf571db78d1 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?P=C3=A1draig=20Brady?= <pbrady at redhat.com>
 Date: Fri, 6 Jan 2012 12:16:34 +0000
 Subject: [PATCH] Ensure we don't access the net when building docs
diff --git a/0002-fix-useexisting-deprecation-warnings.patch b/0006-fix-useexisting-deprecation-warnings.patch
similarity index 97%
rename from 0002-fix-useexisting-deprecation-warnings.patch
rename to 0006-fix-useexisting-deprecation-warnings.patch
index 806a0ed..c8a0edc 100644
--- a/0002-fix-useexisting-deprecation-warnings.patch
+++ b/0006-fix-useexisting-deprecation-warnings.patch
@@ -1,4 +1,4 @@
-From 6054e7206bea118b400fe2571c8b23888bb6387a Mon Sep 17 00:00:00 2001
+From 11b750a44399f42a6cf6d4e94ee72752fa098021 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?P=C3=A1draig=20Brady?= <pbrady at redhat.com>
 Date: Thu, 8 Mar 2012 16:32:30 +0000
 Subject: [PATCH] fix useexisting deprecation warnings
diff --git a/openstack-nova.spec b/openstack-nova.spec
index c863fbe..5b84972 100644
--- a/openstack-nova.spec
+++ b/openstack-nova.spec
@@ -2,16 +2,13 @@
 
 Name:             openstack-nova
 Version:          2012.1
-# The Release is in form 0.X.tag as per:
-#   http://fedoraproject.org/wiki/Packaging:NamingGuidelines#Pre-Release_packages
-# So for prereleases always increment X
-Release:          0.10.rc1%{?dist}
+Release:          1%{?dist}
 Summary:          OpenStack Compute (nova)
 
 Group:            Applications/System
 License:          ASL 2.0
 URL:              http://openstack.org/projects/compute/
-Source0:          http://launchpad.net/nova/essex/essex-rc1/+download/nova-%{version}~rc1.tar.gz
+Source0:          http://launchpad.net/nova/essex/2012.1/+download/nova-2012.1.tar.gz
 Source1:          nova.conf
 Source6:          nova.logrotate
 
@@ -31,12 +28,14 @@ Source22:         nova-ifc-template
 Source23:         openstack-nova-db-setup
 
 #
-# patches_base=essex-rc1
+# patches_base=2012.1
 #
-Patch0001: 0001-Ensure-we-don-t-access-the-net-when-building-docs.patch
-Patch0002: 0002-fix-useexisting-deprecation-warnings.patch
+Patch0001: 0001-fix-bug-where-nova-ignores-glance-host-in-imageref.patch
+Patch0002: 0002-Stop-libvirt-test-from-deleting-instances-dir.patch
 Patch0003: 0003-ensure-atomic-manipulation-of-libvirt-disk-images.patch
-Patch0004: 0004-Add-validation-for-OSAPI-server-name-length.patch
+Patch0004: 0004-Fixed-bug-962840-added-a-test-case.patch
+Patch0005: 0005-Ensure-we-don-t-access-the-net-when-building-docs.patch
+Patch0006: 0006-fix-useexisting-deprecation-warnings.patch
 
 BuildArch:        noarch
 BuildRequires:    intltool
@@ -176,6 +175,8 @@ This package contains documentation files for nova.
 %patch0002 -p1
 %patch0003 -p1
 %patch0004 -p1
+%patch0005 -p1
+%patch0006 -p1
 
 find . \( -name .gitignore -o -name .placeholder \) -delete
 
@@ -374,6 +375,9 @@ fi
 %endif
 
 %changelog
+* Sun Apr  8 2012 Pádraig Brady <P at draigBrady.com> - 2012.1-1
+- Update to Essex release
+
 * Thu Mar 29 2012 Russell Bryant <rbryant at redhat.com> 2012.1-0.10.rc1
 - Remove the outdated nova-debug tool
 - CVE-2012-1585 openstack-nova: Long server names grow nova-api log files significantly
diff --git a/sources b/sources
index eaaae2c..a4d3345 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-0ec5593ed39246b96fa0e5b40e01df89  nova-2012.1~rc1.tar.gz
+4a7d2522058b90fb43a6177ea52def60  nova-2012.1.tar.gz


More information about the scm-commits mailing list