Hello community, here is the log from the commit of package openstack-glance for openSUSE:Factory checked in at 2012-01-27 15:22:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/openstack-glance (Old) and /work/SRC/openSUSE:Factory/.openstack-glance.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "openstack-glance", Maintainer is "" Changes: -------- New Changes file: --- /dev/null 2010-08-26 16:28:41.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.openstack-glance.new/openstack-glance.changes 2012-01-27 15:22:58.000000000 +0100 @@ -0,0 +1,178 @@ +------------------------------------------------------------------- +Tue Dec 13 14:38:44 UTC 2011 - [email protected] + +- Merge changes to enable build from git: + + The work was done by Christopher Hofmann <[email protected]>. + + Add from_vcs and no_from_vcs bconds, that can be used in + addition to the BUILD_FROM_VCS macro to decide what to build. + + Add some warning to summary of packages is building from VCS. + + Do not apply patches for the git package. + + Package files that are new in git. + +------------------------------------------------------------------- +Mon Dec 5 11:06:37 UTC 2011 - [email protected] + +- spec cleanup +- added preun/postun sections for initscript handling + +------------------------------------------------------------------- +Fri Sep 23 10:01:53 UTC 2011 - [email protected] + +- update to 2011.3 (Diablo) + +------------------------------------------------------------------- +Wed Jun 1 16:16:26 CEST 2011 - [email protected] + +- update to bzr rev 139 +- fixed version +- fixed URL + +------------------------------------------------------------------- +Thu Apr 21 23:33:02 CEST 2011 - [email protected] + +- update to bzr rev 123 + - modified documentation to show more first-time user friendly examples on using glance. + - Require user confirmation for "bin/glance clear" and "bin/glance delete <id>" + - Allow for override with -f/--force command-line option + - Adds a test case for updating an image's Name attribute. glance update was not regarding 'name' as a top-level modifiable attribute... + - Mark image properties as deleted when deleting images. + - Added a unit test to verify public images and their properties get deleted when running a 'glance clear' command. + - Add log_file to example glance.conf + - Make sure we use get_option() when dealing with boolean values read from configuration files...otherwise "False" is True :( + +------------------------------------------------------------------- +Tue Apr 19 12:09:08 CEST 2011 - [email protected] + +- update to bzr rev 116 + - start of diablo release + - Fake merge with ancient trunk. This is only so that people who "accidentally" have been following lp:~hudson-openstack/glance/trunk will not have problems updating to this. + +------------------------------------------------------------------- +Fri Apr 15 13:38:35 CEST 2011 - [email protected] + +- update to bzr rev 114 + - Final versioning for Cactus +- updated version to 2011.2 + +------------------------------------------------------------------- +Thu Apr 14 08:14:17 CEST 2011 - [email protected] + +- update to bzr rev 113 + +------------------------------------------------------------------- +Tue Apr 12 15:22:32 CEST 2011 - [email protected] + +- update to bzr rev 108 + +------------------------------------------------------------------- +Mon Apr 4 14:13:12 CEST 2011 - [email protected] + +- update to bzr rev 100 + +- Updates to the Registry API such that only external requests to +- update image properties purge existing properties. The update_image +- call now contains an extra flag to purge_props which is set to +- True for external requests but False internally. +- This resolves with revision 99 where Glance API incidentally deleted image metadata when uploading new images. +- Update the glance registry so that it marks properties as deleted if they are no longer exist when images are updated. +- Simple one.. just add back the Changelog I removed by accident in r94. Fixes bug #742353 +- Adds checksumming to Glance. +- The ETag header is now properly set to the image's checksum now for all GET /images/<ID>, HEAD /images/<ID>, POST /images and PUT /images/<ID> operations. +- Adds unit tests verifying the checksumming behaviour in the API, and in the Swift and Filesystem backend stores. +- Includes migration script. +- NOTE: This does not include the DB migration script. Separate bug will be filed for that. +- Add migration testing and migration for disk_format/container_format +- Start eventlet WSGI server with a logger to avoid stdout output. +- Adds robust functional testing to Glance. +- Removed glance-combined. Fixed README +- Change #!/usr/bin/python to #!/usr/bin/env python. +- Removes glance-combined and fixes TypeError from bad function calls in glance-manage. +- Support account:user:key in Swift URIs. Adds unit tests for various calls to parse_swift_tokens() +- Adds documentation on configuring logging and a unit test for checking simple log output +- A quick patch to allow running the test suite on an alternate db backend. + +------------------------------------------------------------------- +Thu Mar 17 10:21:43 CET 2011 - [email protected] + +- added new configuration files +- replaced hardcoded paths in spec file with variables + +------------------------------------------------------------------- +Fri Mar 11 08:19:22 CET 2011 - [email protected] + +- renamed package python-glance to openstack-glance + +------------------------------------------------------------------- +Thu Mar 10 07:32:23 CET 2011 - [email protected] + +- update to bzr rev 86 + - Fixes client update_image to work like create_image. + - Adds disk_format and container_format to Image, and + removes the type column. + - Adds ability for Swift to be used as a full-fledged backend. + - Adds POST/PUT capabilities to the SwiftBackend + - Fixes passing of None values in metadata by turning them into strings + - fixes the passing of the deleted column by converting it to and from a bool + - Add Glance CLI tool + +------------------------------------------------------------------- +Thu Mar 3 18:14:54 CET 2011 - [email protected] + +- update to bzr rev 79 + - Makes --kernel and --ramdisk required arguments for glance-upload + since Nova currently requires them + - Add sys.path mangling to glance-upload + - Reverts Image `type` back to the old behavior of being nullable + - Work around Eventlet exception clearing by memorizing exception + context and re-raising using 3-arg form + +------------------------------------------------------------------- +Wed Feb 23 10:04:09 UTC 2011 - [email protected] + +- update to bzr rev 74: + - add vhd as recognized image type + +------------------------------------------------------------------- +Wed Feb 16 21:00:25 UTC 2011 - [email protected] + +- start tracking development releases +- update to bzr rev 73 + * lots of fixes, see changelog +- glance changed the versioning scheme similar to nova + +------------------------------------------------------------------- +Mon Feb 14 19:34:14 UTC 2011 - [email protected] + +- fix init script configuration parsing + +------------------------------------------------------------------- +Fri Feb 11 14:34:43 UTC 2011 - [email protected] + +- add requires for python-eventlet,-webob,-sqlalchemy,-mysql + +------------------------------------------------------------------- +Wed Feb 9 14:37:13 UTC 2011 - [email protected] + +- add init script to start / stop the glance services + +------------------------------------------------------------------- +Thu Feb 3 09:54:11 UTC 2011 - [email protected] + +- official bexar release + * bump version to 0.1.7 + +------------------------------------------------------------------- +Tue Feb 1 17:20:39 CET 2011 - [email protected] + +- bumped to version 0.1.6 (bexar-rc, released on 2011-01-28) +- fixed required packages: + + python-gflags + + python-daemon + + python-routes + + python-argparse + +------------------------------------------------------------------- +Wed Jan 26 10:57:30 UTC 2011 - [email protected] + +- initial package of python-glance + New: ---- glance-2011.3.patch glance-2011.3.tar.gz lp_845788_glance_client_zero_length.patch lp_850425_remote_swift_image_streaming.patch openstack-glance.changes openstack-glance.init openstack-glance.spec ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ openstack-glance.spec ++++++ # spec file for package openstack-glance # # Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2011 B1 Systems GmbH, Vohburg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # options to forcefully build with/without vcs %bcond_with from_vcs %bcond_with no_from_vcs %if %{with from_vcs} %define BUILD_FROM_VCS 1 %endif %if %{with no_from_vcs} %define BUILD_FROM_VCS 0 %endif %{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %if 0%{?BUILD_FROM_VCS} %define vcs_summary_warn -- Git Snapshot %else %define vcs_summary_warn %null %endif %define shortname glance Name: openstack-glance Version: 2011.3 %if 0%{?BUILD_FROM_VCS} %define _version git-master %else %define _version 2011.3 %endif Release: 1 License: ASL 2.0 Summary: Discover, Register and Retrieve virtual machine images %{vcs_summary_warn} Url: http://glance.openstack.org/ Group: Development/Libraries/Python Source0: glance-%{_version}.tar.gz Source1: openstack-glance.init Patch0: glance-2011.3.patch Patch1: lp_845788_glance_client_zero_length.patch Patch2: lp_850425_remote_swift_image_streaming.patch BuildRequires: fdupes BuildRequires: intltool BuildRequires: python-Sphinx BuildRequires: python-devel BuildRequires: python-distribute BuildRequires: python-distutils-extra BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: openstack-swift Requires: python-PasteDeploy Requires: python-anyjson Requires: python-argparse Requires: python-boto Requires: python-eventlet Requires: python-greenlet Requires: python-httplib2 Requires: python-kombu Requires: python-routes Requires: python-sqlalchemy Requires: python-sqlalchemy-migrate Requires: python-webob Requires: python-wsgiref Requires: python-xattr %if 0%{?suse_version} > 1110 Requires(pre): pwdutils %else Requires(pre): shadow-utils %endif %define sharedstatedir %{_localstatedir}/lib %description The Glance project provides services for discovering, registering, and retrieving virtual machine images. Glance has a RESTful API that allows querying of VM image metadata as well as retrieval of the actual image. %package -n python-glance Summary: OpenStack glance python files %{vcs_summary_warn} Group: Development/Languages/Python %description -n python-glance This package contains the python files for glance. %prep %setup -q -n %{shortname}-%{_version} %if !(0%{?BUILD_FROM_VCS}) %patch0 %patch1 -p1 %patch2 -p1 %endif %build mkdir etc/glance mv etc/*.conf etc/glance/ mv etc/*.sample etc/glance/ python setup.py build %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} mkdir -p %{buildroot}%{_initrddir} mkdir -p %{buildroot}%{_sbindir} install -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/openstack-glance ln -s ../..%{_initrddir}/openstack-glance %{buildroot}%{_sbindir}/rcopenstack-glance install -d -m 755 %{buildroot}%{sharedstatedir}/glance 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}/run/glance rm -rf %{buildroot}%{_datadir}/doc/glance %pre getent group glance >/dev/null || groupadd -r glance getent passwd glance >/dev/null || useradd -r -g glance -d %{sharedstatedir}/glance -s /sbin/nologin -c "OpenStack glance Daemons" glance exit 0 %preun %stop_on_removal openstack-glance %postun %restart_on_update openstack-glance %insserv_cleanup openstack-glance %clean rm -rf %{buildroot} %files %defattr(-,root,root) %doc README %{_initrddir}/openstack-glance %{_sbindir}/rcopenstack-glance %dir %{_sysconfdir}/glance %config(noreplace) %{_sysconfdir}/glance/glance-api.conf %if 0%{?BUILD_FROM_VCS} %config(noreplace) %{_sysconfdir}/glance/glance-cache.conf %else %config(noreplace) %{_sysconfdir}/glance/glance-prefetcher.conf %config(noreplace) %{_sysconfdir}/glance/glance-pruner.conf %config(noreplace) %{_sysconfdir}/glance/glance-reaper.conf %endif %config(noreplace) %{_sysconfdir}/glance/glance-registry.conf %config(noreplace) %{_sysconfdir}/glance/glance-scrubber.conf %config(noreplace) %{_sysconfdir}/glance/logging.cnf.sample %dir %attr(0755, glance, root) %{_localstatedir}/lib/glance %dir %attr(0755, glance, root) %{_localstatedir}/lib/glance/images %dir %attr(0755, glance, root) %{_localstatedir}/log/glance %ghost %dir %attr(0755, glance, root) %{_localstatedir}/run/glance %{_bindir}/glance %{_bindir}/glance-api %{_bindir}/glance-cache-prefetcher %{_bindir}/glance-cache-pruner %if 0%{?BUILD_FROM_VCS} %{_bindir}/glance-cache-cleaner %{_bindir}/glance-cache-manage %{_bindir}/glance-cache-queue-image %else %{_bindir}/glance-cache-reaper %endif %{_bindir}/glance-control %{_bindir}/glance-manage %{_bindir}/glance-registry %{_bindir}/glance-scrubber %if !(0%{?BUILD_FROM_VCS}) %{_bindir}/glance-upload %endif %files -n python-glance %defattr(-,root,root,-) %{python_sitelib} %changelog ++++++ glance-2011.3.patch ++++++ Index: etc/glance-api.conf =================================================================== --- etc/glance-api.conf.orig +++ etc/glance-api.conf @@ -132,9 +132,9 @@ image_cache_stall_timeout = 86400 delayed_delete = False [pipeline:glance-api] -pipeline = versionnegotiation context apiv1app +# pipeline = versionnegotiation context apiv1app # NOTE: use the following pipeline for keystone -# pipeline = versionnegotiation authtoken context apiv1app +pipeline = versionnegotiation authtoken context apiv1app # To enable Image Cache Management API replace pipeline with below: # pipeline = versionnegotiation context imagecache apiv1app @@ -165,7 +165,7 @@ service_protocol = http service_host = 127.0.0.1 service_port = 5000 auth_host = 127.0.0.1 -auth_port = 5001 +auth_port = 35357 auth_protocol = http auth_uri = http://127.0.0.1:5000/ admin_token = 999888777666 Index: etc/glance-registry.conf =================================================================== --- etc/glance-registry.conf.orig +++ etc/glance-registry.conf @@ -21,7 +21,7 @@ use_syslog = False # SQLAlchemy connection string for the reference implementation # registry server. Any valid SQLAlchemy connection string is fine. # See: http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/connections.html#sqlalchemy.create_engine -sql_connection = sqlite:///glance.sqlite +sql_connection = sqlite:////var/lib/glance/glance.sqlite # Period in seconds after which SQLAlchemy should reestablish its connection # to the database. @@ -41,9 +41,9 @@ api_limit_max = 1000 limit_param_default = 25 [pipeline:glance-registry] -pipeline = context registryapp +# pipeline = context registryapp # NOTE: use the following pipeline for keystone -# pipeline = authtoken keystone_shim context registryapp +pipeline = authtoken keystone_shim context registryapp [app:registryapp] paste.app_factory = glance.registry.server:app_factory @@ -58,7 +58,7 @@ service_protocol = http service_host = 127.0.0.1 service_port = 5000 auth_host = 127.0.0.1 -auth_port = 5001 +auth_port = 35357 auth_protocol = http auth_uri = http://127.0.0.1:5000/ admin_token = 999888777666 Index: etc/glance-scrubber.conf =================================================================== --- etc/glance-scrubber.conf.orig +++ etc/glance-scrubber.conf @@ -24,7 +24,7 @@ wakeup_time = 300 # SQLAlchemy connection string for the reference implementation # registry server. Any valid SQLAlchemy connection string is fine. # See: http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/connections.html#sqlalchemy.create_engine -sql_connection = sqlite:///glance.sqlite +sql_connection = sqlite:////var/lib/glance/glance.sqlite # Period in seconds after which SQLAlchemy should reestablish its connection # to the database. ++++++ lp_845788_glance_client_zero_length.patch ++++++ Origin: upstream, https://github.com/openstack/glance/commit/6cfff16f2dc22a870bfe3808a7895dfbbaa11369 Bug: https://bugs.launchpad.net/glance/+bug/845788 commit 6cfff16f2dc22a870bfe3808a7895dfbbaa11369 Author: Jay Pipes <[email protected]> Date: Fri Sep 9 13:03:19 2011 -0400 Fixes LP Bug#845788 glance.client.image_update needed to calculate size so that Glance's Swift driver can do chunking properly for large objects. Change-Id: Iafe8034a710cff53a0caa3ae5e9ee3a3adda19f8 --- a/glance/client.py +++ b/glance/client.py @@ -96,6 +96,33 @@ class V1Client(base_client.BaseClient): image = utils.get_image_meta_from_headers(res) return image + def _get_image_size(self, image_data): + """ + Analyzes the incoming image file and attempts to determine + its size. + + :param image_data: The input to the client, typically a file + redirected from stdin. + :retval The image file's size or None if it cannot be determined. + """ + # For large images, we need to supply the size of the + # image file. See LP Bugs #827660 and #845788. + if hasattr(image_data, 'seek') and hasattr(image_data, 'tell'): + try: + image_data.seek(0, os.SEEK_END) + image_size = image_data.tell() + image_data.seek(0) + return image_size + except IOError, e: + if e.errno == errno.ESPIPE: + # Illegal seek. This means the user is trying + # to pipe image data to the client, e.g. + # echo testdata | bin/glance add blah..., or + # that stdin is empty + return None + else: + raise + def add_image(self, image_meta=None, image_data=None): """ Tells Glance about an image's metadata as well @@ -114,24 +141,10 @@ class V1Client(base_client.BaseClient): if image_data: body = image_data headers['content-type'] = 'application/octet-stream' - # For large images, we need to supply the size of the - # image file. See LP Bug #827660. - if hasattr(image_data, 'seek') and hasattr(image_data, 'tell'): - try: - image_data.seek(0, os.SEEK_END) - image_size = image_data.tell() - image_data.seek(0) - headers['x-image-meta-size'] = image_size - headers['content-length'] = image_size - except IOError, e: - if e.errno == errno.ESPIPE: - # Illegal seek. This means the user is trying - # to pipe image data to the client, e.g. - # echo testdata | bin/glance add blah..., or - # that stdin is empty - pass - else: - raise + image_size = self._get_image_size(image_data) + if image_size: + headers['x-image-meta-size'] = image_size + headers['content-length'] = image_size else: body = None @@ -151,6 +164,10 @@ class V1Client(base_client.BaseClient): if image_data: body = image_data headers['content-type'] = 'application/octet-stream' + image_size = self._get_image_size(image_data) + if image_size: + headers['x-image-meta-size'] = image_size + headers['content-length'] = image_size else: body = None ++++++ lp_850425_remote_swift_image_streaming.patch ++++++ Description: Make streaming from swift actually work. Author: Brian Waldon <[email protected]> Commit: 4847ceb59fe35481fd42ddc9369b7d3814eca721 diff -Naurp glance-2011.3.orig//glance/store/swift.py glance-2011.3//glance/store/swift.py --- glance-2011.3.orig//glance/store/swift.py 2011-09-21 16:46:35.000000000 -0400 +++ glance-2011.3//glance/store/swift.py 2011-09-27 14:26:46.231166002 -0400 @@ -260,7 +260,7 @@ class Store(glance.store.base.Store): # "Expected %s byte file, Swift has %s bytes" % # (expected_size, obj_size)) - return (resp_body, None) + return (resp_body, resp_headers.get('content-length')) def _make_swift_connection(self, auth_url, user, key): """ diff -Naurp glance-2011.3.orig//glance/tests/functional/test_swift.py glance-2011.3//glance/tests/functional/test_swift.py --- glance-2011.3.orig//glance/tests/functional/test_swift.py 2011-09-21 16:46:35.000000000 -0400 +++ glance-2011.3//glance/tests/functional/test_swift.py 2011-09-27 14:26:46.231166002 -0400 @@ -385,3 +385,86 @@ class TestSwift(test_api.TestApi): hashlib.md5("*" * FIVE_MB).hexdigest()) self.stop_servers() + + @skip_if_disabled + def test_remote_image(self): + """ + Ensure we can retrieve an image that was not stored by glance itself + """ + self.cleanup() + + self.start_servers(**self.__dict__.copy()) + + api_port = self.api_port + registry_port = self.registry_port + + # POST /images with public image named Image1 + image_data = "*" * FIVE_MB + headers = {'Content-Type': 'application/octet-stream', + 'X-Image-Meta-Name': 'Image1', + 'X-Image-Meta-Is-Public': 'True'} + path = "http://%s:%d/v1/images" % ("0.0.0.0", self.api_port) + http = httplib2.Http() + response, content = http.request(path, 'POST', headers=headers, + body=image_data) + self.assertEqual(response.status, 201, content) + data = json.loads(content) + self.assertEqual(data['image']['checksum'], + hashlib.md5(image_data).hexdigest()) + self.assertEqual(data['image']['size'], FIVE_MB) + self.assertEqual(data['image']['name'], "Image1") + self.assertEqual(data['image']['is_public'], True) + + # GET /images/1 and make sure data was uploaded + path = "http://%s:%d/v1/images/1" % ("0.0.0.0", self.api_port) + http = httplib2.Http() + response, content = http.request(path, 'GET') + self.assertEqual(response.status, 200) + self.assertEqual(response['content-length'], str(FIVE_MB)) + + self.assertEqual(content, "*" * FIVE_MB) + self.assertEqual(hashlib.md5(content).hexdigest(), + hashlib.md5("*" * FIVE_MB).hexdigest()) + + # use this header as the location for the next image + swift_location = response['x-image-meta-location'] + + # POST /images with public image named Image1 without uploading data + image_data = "*" * FIVE_MB + headers = {'Content-Type': 'application/octet-stream', + 'X-Image-Meta-Name': 'Image1', + 'X-Image-Meta-Is-Public': 'True', + 'X-Image-Meta-Location': swift_location} + path = "http://%s:%d/v1/images" % ("0.0.0.0", self.api_port) + http = httplib2.Http() + response, content = http.request(path, 'POST', headers=headers) + self.assertEqual(response.status, 201, content) + data = json.loads(content) + self.assertEqual(data['image']['checksum'], None) + self.assertEqual(data['image']['size'], 0) + self.assertEqual(data['image']['name'], "Image1") + self.assertEqual(data['image']['is_public'], True) + + # GET /images/2 ensuring the data already in swift is accessible + path = "http://%s:%d/v1/images/2" % ("0.0.0.0", self.api_port) + http = httplib2.Http() + response, content = http.request(path, 'GET') + self.assertEqual(response.status, 200) + self.assertEqual(response['content-length'], str(FIVE_MB)) + + self.assertEqual(content, "*" * FIVE_MB) + self.assertEqual(hashlib.md5(content).hexdigest(), + hashlib.md5("*" * FIVE_MB).hexdigest()) + + # DELETE /images/1 and /image/2 + # Verify image and all chunks are gone... + path = "http://%s:%d/v1/images/1" % ("0.0.0.0", self.api_port) + http = httplib2.Http() + response, content = http.request(path, 'DELETE') + self.assertEqual(response.status, 200) + path = "http://%s:%d/v1/images/2" % ("0.0.0.0", self.api_port) + http = httplib2.Http() + response, content = http.request(path, 'DELETE') + self.assertEqual(response.status, 200) + + self.stop_servers() diff -Naurp glance-2011.3.orig//glance/tests/unit/test_swift_store.py glance-2011.3//glance/tests/unit/test_swift_store.py --- glance-2011.3.orig//glance/tests/unit/test_swift_store.py 2011-09-21 16:46:35.000000000 -0400 +++ glance-2011.3//glance/tests/unit/test_swift_store.py 2011-09-27 14:26:46.235166002 -0400 @@ -198,7 +198,7 @@ class TestStore(unittest.TestCase): """Test a "normal" retrieval of an image in chunks""" loc = get_location_from_uri("swift://user:key@auth_address/glance/2") (image_swift, image_size) = self.store.get(loc) - self.assertEqual(image_size, None) + self.assertEqual(image_size, 5120) expected_data = "*" * FIVE_KB data = "" @@ -216,7 +216,7 @@ class TestStore(unittest.TestCase): loc = get_location_from_uri("swift+http://user:key@auth_address/" "glance/2") (image_swift, image_size) = self.store.get(loc) - self.assertEqual(image_size, None) + self.assertEqual(image_size, 5120) expected_data = "*" * FIVE_KB data = "" ++++++ openstack-glance.init ++++++ #!/bin/sh # ### BEGIN INIT INFO # Provides: openstack-glance # Required-Start: $syslog $remote_fs # Should-Start: $time mysql # Required-Stop: $syslog $remote_fs # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: OpenStack glance service # Description: The OpenStack glance service allows to # Discover, Register and Retrieve virtual machine images ### END INIT INFO GLANCE_CONTROL=/usr/bin/glance-control GLANCE_API_BIN=/usr/bin/glance-api GLANCE_REG_BIN=/usr/bin/glance-registry GLANCE_RUN_DIR=/var/run/glance mkdir -p $GLANCE_RUN_DIR BAD=false for i in $GLANCE_CONTROL $GLANCE_API_BIN $GLANCE_REG_BIN; do test -x $i && continue echo "$i not installed" BAD=true done # Special treatment of stop for LSB conformance if $BAD; then test "$1" = "stop" && exit 0 exit 5 fi # Check for existence of needed config file and read it GLANCE_API_CONFIG=/etc/glance/glance-api.conf if ! test -r $GLANCE_API_CONFIG; then echo "$GLANCE_API_CONFIG not existing" test "$1" = "stop" && exit 0 exit 6 fi GLANCE_REGISTRY_CONFIG=/etc/glance/glance-registry.conf if ! test -r $GLANCE_REGISTRY_CONFIG; then echo "$GLANCE_REGISTRY_CONFIG not existing" test "$1" = "stop" && exit 0 exit 6 fi . /etc/rc.status rc_reset # Return values acc. to LSB for all commands but status: # 0 - success # 1 - generic or unspecified error # 2 - invalid or excess argument(s) # 3 - unimplemented feature (e.g. "reload") # 4 - user had insufficient privileges # 5 - program is not installed # 6 - program is not configured # 7 - program is not running # 8--199 - reserved (8--99 LSB, 100--149 distrib, 150--199 appl) # # Note that starting an already running service, stopping # or restarting a not-running service as well as the restart # with force-reload (in case signaling is not supported) are # considered a success. case "$1" in start) echo -n "Starting glance" /sbin/startproc -q $GLANCE_CONTROL all start rc_status -v ;; stop) echo -n "Shutting down glance" /sbin/startproc -q $GLANCE_CONTROL all stop rc_status -v ;; try-restart|condrestart) if test "$1" = "condrestart"; then echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}" fi $0 status if test $? = 0; then $0 restart else rc_reset # Not running is not a failure. fi rc_status ;; restart) $GLANCE_CONTROL all restart rc_status ;; force-reload) $0 try-restart rc_status ;; reload) echo -n "Reload service glance " rc_failed 3 rc_status -v ;; status) echo -n "Checking for service glance-api" /sbin/checkproc $GLANCE_API_BIN rc_status -v echo -n "Checking for service glance-registry" /sbin/checkproc $GLANCE_REG_BIN rc_status -v ;; *) echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}" exit 1 ;; esac rc_exit -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
