Hello community,

here is the log from the commit of package openstack-glance for 
openSUSE:Factory checked in at 2014-01-30 17:43:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/openstack-glance (Old)
 and      /work/SRC/openSUSE:Factory/.openstack-glance.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "openstack-glance"

Changes:
--------
--- /work/SRC/openSUSE:Factory/openstack-glance/openstack-glance.changes        
2014-01-23 15:50:33.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.openstack-glance.new/openstack-glance.changes   
2014-01-30 17:43:31.000000000 +0100
@@ -1,0 +2,19 @@
+Wed Jan 29 09:12:31 UTC 2014 - [email protected]
+
+- Add refresh_patches source service
+
+-------------------------------------------------------------------
+Wed Jan 29 08:14:09 UTC 2014 - [email protected]
+
+- Package /var/lock/glance, and set lock_path in config files.
+- Use correct group name for directory ownerships.
+- Do not make /var/run/glance readable by others.
+
+-------------------------------------------------------------------
+Tue Jan 28 07:12:07 UTC 2014 - [email protected]
+
+- Backport some rbd-related fix:
+  + 0001-RBD-add-now-returns-correct-size-if-given-zero.patch
+    Returns the correct size when adding image
+
+-------------------------------------------------------------------

New:
----
  0001-RBD-add-now-returns-correct-size-if-given-zero.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ openstack-glance.spec ++++++
--- /var/tmp/diff_new_pack.ncaBPs/_old  2014-01-30 17:43:32.000000000 +0100
+++ /var/tmp/diff_new_pack.ncaBPs/_new  2014-01-30 17:43:32.000000000 +0100
@@ -33,6 +33,8 @@
 Source5:        %{name}.logrotate
 # PATCH-FIX-OPENSUSE: [email protected] -- Don't test qpid functionality, we 
have no packages
 Patch2:         glance-dont-test-qpid.patch
+# https://review.openstack.org/#/c/59079/ 
https://bugs.launchpad.net/glance/+bug/1256044
+Patch3:         0001-RBD-add-now-returns-correct-size-if-given-zero.patch
 BuildRequires:  crudini
 BuildRequires:  fdupes
 BuildRequires:  openstack-suse-macros
@@ -139,6 +141,7 @@
 %prep
 %setup -q -n glance-2013.2.2.dev1.g5cd7a22
 %patch2 -p1
+%patch3 -p1
 %openstack_cleanup_prep
 sed -i "s|^#!.*||" tools/migrate_image_owners.py # Fix non-executable script 
warning
 # NOTE(saschpe): The following test contains a pesky (commented) race condition
@@ -156,6 +159,7 @@
 install -d -m 755 %{buildroot}%{_localstatedir}/lib/glance
 install -d -m 755 %{buildroot}%{_localstatedir}/lib/glance/images
 install -d -m 755 %{buildroot}%{_localstatedir}/log/glance
+install -d -m 755 %{buildroot}%{_localstatedir}/lock/glance
 install -d -m 755 %{buildroot}%{_localstatedir}/run/glance
 
 ### configuration files
@@ -192,7 +196,9 @@
 done
 #NOTE(saschpe): Needed for (at least) ceilometer to collect image counters 
stats:
 crudini --set %{buildroot}%{_sysconfdir}/glance/glance-api.conf DEFAULT 
notifier_strategy rabbit
+crudini --set %{buildroot}%{_sysconfdir}/glance/glance-api.conf DEFAULT 
lock_path /var/lock/glance
 crudini --set %{buildroot}%{_sysconfdir}/glance/glance-api.conf 
keystone_authtoken signing_dir /var/cache/%component/keystone-signing
+crudini --set %{buildroot}%{_sysconfdir}/glance/glance-scrubber.conf DEFAULT 
lock_path /var/lock/glance
 
 ### authentication cache dir
 mkdir -p %{buildroot}%{_localstatedir}/cache/glance/api
@@ -217,10 +223,10 @@
 %defattr(-,root,root)
 %doc LICENSE README.rst
 %dir %{_sysconfdir}/glance
-%config(noreplace) %attr(0640, root, %{username}) 
%{_sysconfdir}/glance/glance-api.conf
-%config(noreplace) %attr(0640, root, %{username}) 
%{_sysconfdir}/glance/glance-cache.conf
-%config(noreplace) %attr(0640, root, %{username}) 
%{_sysconfdir}/glance/glance-registry.conf
-%config(noreplace) %attr(0640, root, %{username}) 
%{_sysconfdir}/glance/glance-scrubber.conf
+%config(noreplace) %attr(0640, root, %{groupname}) 
%{_sysconfdir}/glance/glance-api.conf
+%config(noreplace) %attr(0640, root, %{groupname}) 
%{_sysconfdir}/glance/glance-cache.conf
+%config(noreplace) %attr(0640, root, %{groupname}) 
%{_sysconfdir}/glance/glance-registry.conf
+%config(noreplace) %attr(0640, root, %{groupname}) 
%{_sysconfdir}/glance/glance-scrubber.conf
 %config %{_sysconfdir}/glance/glance-api-paste.ini
 %config %{_sysconfdir}/glance/glance-registry-paste.ini
 %config %{_sysconfdir}/glance/logging.cnf.sample
@@ -228,10 +234,11 @@
 %config %{_sysconfdir}/glance/property-protections.conf.sample
 %config %{_sysconfdir}/glance/schema-image.json
 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
-%dir %attr(0755, %{username}, %{username}) %{_localstatedir}/lib/glance
-%dir %attr(0755, %{username}, %{username}) %{_localstatedir}/lib/glance/images
-%dir %attr(0755, %{username}, %{username}) %{_localstatedir}/log/glance
-%ghost %dir %attr(0755, %{username}, root) %{_localstatedir}/run/glance
+%dir %attr(0755, %{username}, %{groupname}) %{_localstatedir}/lib/glance
+%dir %attr(0755, %{username}, %{groupname}) %{_localstatedir}/lib/glance/images
+%dir %attr(0755, %{username}, %{groupname}) %{_localstatedir}/log/glance
+%dir %attr(0750, %{username}, %{groupname}) %{_localstatedir}/lock/glance
+%ghost %dir %attr(0750, %{username}, %{groupname}) %{_localstatedir}/run/glance
 %{_initddir}/openstack-glance-api
 %{_initddir}/openstack-glance-registry
 %{_sbindir}/rcopenstack-glance-api
@@ -255,7 +262,7 @@
 %{_mandir}/man1/glance-manage.1%{?ext_man}
 %{_mandir}/man1/glance-registry.1%{?ext_man}
 %{_mandir}/man1/glance-scrubber.1%{?ext_man}
-%dir %attr(0755, %{username}, %{username}) %{_localstatedir}/cache/glance
+%dir %attr(0755, %{username}, %{groupname}) %{_localstatedir}/cache/glance
 
 %files -n python-glance
 %defattr(-,root,root,-)

++++++ 0001-RBD-add-now-returns-correct-size-if-given-zero.patch ++++++
>From 2119227b965eaea5062e544612fd986c51564ace Mon Sep 17 00:00:00 2001
From: Edward Hope-Morley <[email protected]>
Date: Thu, 28 Nov 2013 17:11:41 +0000
Subject: [PATCH] RBD add() now returns correct size if given zero

If the RBD store add() is provided with image_size of zero, it
will calculate based on data provided and return the new size.

Change-Id: I06375bcfef7808905b466432e5ca100c942297eb
Closes-bug: 1256044
---
 glance/store/rbd.py                 |  9 ++++++++-
 glance/tests/unit/test_rbd_store.py | 27 +++++++++++++++++++++++----
 2 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/glance/store/rbd.py b/glance/store/rbd.py
index c53df5f..ecfd733 100644
--- a/glance/store/rbd.py
+++ b/glance/store/rbd.py
@@ -327,6 +327,7 @@ class Store(glance.store.base.Store):
                         _('RBD image %s already exists') % image_id)
                 try:
                     with rbd.Image(ioctx, image_name) as image:
+                        bytes_written = 0
                         offset = 0
                         chunks = utils.chunkreadable(image_file,
                                                      self.chunk_size)
@@ -336,7 +337,9 @@ class Store(glance.store.base.Store):
                             # be slower so setting a higher chunk size may
                             # speed things up a bit.
                             if image_size == 0:
-                                length = offset + len(chunk)
+                                chunk_length = len(chunk)
+                                length = offset + chunk_length
+                                bytes_written += chunk_length
                                 LOG.debug(_("resizing image to %s KiB") %
                                           (length / 1024))
                                 image.resize(length)
@@ -356,6 +359,10 @@ class Store(glance.store.base.Store):
 
                     raise exc
 
+        # Make sure we send back the image size whether provided or inferred.
+        if image_size == 0:
+            image_size = bytes_written
+
         return (loc.get_uri(), image_size, checksum.hexdigest(), {})
 
     def delete(self, location):
diff --git a/glance/tests/unit/test_rbd_store.py 
b/glance/tests/unit/test_rbd_store.py
index 23e055f..7eb799b 100644
--- a/glance/tests/unit/test_rbd_store.py
+++ b/glance/tests/unit/test_rbd_store.py
@@ -14,8 +14,12 @@
 #    under the License.
 
 import StringIO
+
+import mock
+
 from glance.common import exception
 from glance.common import utils
+from glance.openstack.common import units
 import glance.store.rbd as rbd_store
 from glance.store.location import Location
 from glance.store.rbd import StoreLocation
@@ -37,6 +41,20 @@ class TestStore(base.StoreClearingUnitTest):
         self.store_specs = {'image': 'fake_image',
                             'snapshot': 'fake_snapshot'}
         self.location = StoreLocation(self.store_specs)
+        # Provide enough data to get more than one chunk iteration.
+        self.data_len = 3 * units.Ki
+        self.data_iter = StringIO.StringIO('*' * self.data_len)
+
+    def test_add_w_image_size_zero(self):
+        """Assert that correct size is returned even though 0 was provided."""
+        self.store.chunk_size = units.Ki
+        with mock.patch.object(rbd_store.rbd.Image, 'resize') as resize:
+            with mock.patch.object(rbd_store.rbd.Image, 'write') as write:
+                ret = self.store.add('fake_image_id', self.data_iter, 0)
+
+        resize.assert_called()
+        write.assert_called()
+        self.assertEquals(ret[1], self.data_len)
 
     def test_add_w_rbd_image_exception(self):
         def _fake_create_image(*args, **kwargs):
@@ -54,7 +72,7 @@ class TestStore(base.StoreClearingUnitTest):
         self.stubs.Set(mock_rbd.Image, '__enter__', _fake_enter)
 
         self.assertRaises(exception.NotFound, self.store.add,
-                          'fake_image_id', StringIO.StringIO('xx'), 2)
+                          'fake_image_id', self.data_iter, self.data_len)
 
         self.called_commands_expected = ['create', 'delete']
 
@@ -65,7 +83,7 @@ class TestStore(base.StoreClearingUnitTest):
 
         self.stubs.Set(self.store, '_create_image', _fake_create_image)
         self.assertRaises(exception.Duplicate, self.store.add,
-                          'fake_image_id', StringIO.StringIO('xx'), 2)
+                          'fake_image_id', self.data_iter, self.data_len)
         self.called_commands_expected = ['create']
 
     def test_delete(self):
@@ -136,9 +154,10 @@ class TestStore(base.StoreClearingUnitTest):
 
         self.stubs.Set(mock_rbd.Image, 'write', _fake_write)
         self.stubs.Set(self.store, '_delete_image', _fake_delete_image)
-        data = utils.LimitingReader(StringIO.StringIO('abcd'), 4)
+        data = utils.LimitingReader(self.data_iter, self.data_len)
         self.assertRaises(exception.ImageSizeLimitExceeded,
-                          self.store.add, 'fake_image_id', data, 5)
+                          self.store.add, 'fake_image_id',
+                          data, self.data_len + 1)
 
         self.called_commands_expected = ['write', 'delete']
 
-- 
1.8.4

++++++ _service ++++++
--- /var/tmp/diff_new_pack.ncaBPs/_old  2014-01-30 17:43:32.000000000 +0100
+++ /var/tmp/diff_new_pack.ncaBPs/_new  2014-01-30 17:43:32.000000000 +0100
@@ -5,4 +5,8 @@
     <param name="email">[email protected]</param>
     <param name="plain-version">True</param>
   </service>
+
+  <service name="refresh_patches" mode="disabled">
+    <param name="changesgenerate">enable</param>
+  </service>
 </services>

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to