Merge lp:~jaypipes/glance/versioning into lp:~glance-coresec/glance/cactus-trunk

Proposed by Jay Pipes
Status: Merged
Merged at revision: 58
Proposed branch: lp:~jaypipes/glance/versioning
Merge into: lp:~glance-coresec/glance/cactus-trunk
Diff against target: 769 lines (+214/-79)
23 files modified
bin/glance-api (+8/-8)
bin/glance-registry (+10/-8)
doc/source/conf.py (+5/-3)
glance/__init__.py (+16/-0)
glance/client.py (+1/-1)
glance/common/__init__.py (+16/-0)
glance/common/db/__init__.py (+2/-1)
glance/common/db/sqlalchemy/__init__.py (+16/-0)
glance/common/db/sqlalchemy/session.py (+1/-0)
glance/registry/db/__init__.py (+2/-1)
glance/registry/db/api.py (+2/-0)
glance/registry/db/sqlalchemy/api.py (+2/-0)
glance/registry/server.py (+1/-1)
glance/version.py (+46/-0)
setup.py (+22/-11)
tests/__init__.py (+16/-0)
tests/stubs.py (+2/-4)
tests/unit/__init__.py (+16/-0)
tests/unit/test_api.py (+7/-11)
tests/unit/test_clients.py (+14/-20)
tests/unit/test_registry_api.py (+6/-6)
tests/unit/test_stores.py (+1/-2)
tools/install_venv.py (+2/-2)
To merge this branch: bzr merge lp:~jaypipes/glance/versioning
Reviewer Review Type Date Requested Status
Rick Harris (community) Approve
Vish Ishaya (community) Approve
Devin Carlen (community) Approve
Monty Taylor Pending
Review via email: mp+47714@code.launchpad.net

Commit message

Add dynamic versioning to Glance

Description of the change

Glance now has non-static versioning. Pulled in r56 from Bexar trunk and version.py stuff from Nova.

To post a comment you must log in.
Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve
Revision history for this message
Vish Ishaya (vishvananda) wrote :

looks like lots of whitespace fixes too. LGTM, though

review: Approve
Revision history for this message
Jay Pipes (jaypipes) wrote :

eh, yeah, the whitespace fixes were from the last revision to the Bexar trunk...slipped by me when I created the Cactus trunk this is going into..

Revision history for this message
Rick Harris (rconradharris) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/glance-api'
--- bin/glance-api 2011-01-02 02:47:59 +0000
+++ bin/glance-api 2011-01-27 20:06:13 +0000
@@ -5,17 +5,17 @@
5# Administrator of the National Aeronautics and Space Administration.5# Administrator of the National Aeronautics and Space Administration.
6# All Rights Reserved.6# All Rights Reserved.
7#7#
8# Licensed under the Apache License, Version 2.0 (the "License");8# Licensed under the Apache License, Version 2.0 (the "License"); you may
9# you may not use this file except in compliance with the License.9# not use this file except in compliance with the License. You may obtain
10# You may obtain a copy of the License at10# a copy of the License at
11#11#
12# http://www.apache.org/licenses/LICENSE-2.012# http://www.apache.org/licenses/LICENSE-2.0
13#13#
14# Unless required by applicable law or agreed to in writing, software14# Unless required by applicable law or agreed to in writing, software
15# distributed under the License is distributed on an "AS IS" BASIS,15# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.16# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17# See the License for the specific language governing permissions and17# License for the specific language governing permissions and limitations
18# limitations under the License.18# under the License.
1919
20"""20"""
21Glance API Server21Glance API Server
2222
=== modified file 'bin/glance-registry'
--- bin/glance-registry 2011-01-18 21:01:49 +0000
+++ bin/glance-registry 2011-01-27 20:06:13 +0000
@@ -3,19 +3,21 @@
33
4# Copyright 2010 United States Government as represented by the4# Copyright 2010 United States Government as represented by the
5# Administrator of the National Aeronautics and Space Administration.5# Administrator of the National Aeronautics and Space Administration.
6# Copyright 2011 OpenStack LLC.
6# All Rights Reserved.7# All Rights Reserved.
7#8#
8# Licensed under the Apache License, Version 2.0 (the "License");9# Licensed under the Apache License, Version 2.0 (the "License"); you may
9# you may not use this file except in compliance with the License.10# not use this file except in compliance with the License. You may obtain
10# You may obtain a copy of the License at11# a copy of the License at
11#12#
12# http://www.apache.org/licenses/LICENSE-2.013# http://www.apache.org/licenses/LICENSE-2.0
13#14#
14# Unless required by applicable law or agreed to in writing, software15# Unless required by applicable law or agreed to in writing, software
15# distributed under the License is distributed on an "AS IS" BASIS,16# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.17# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17# See the License for the specific language governing permissions and18# License for the specific language governing permissions and limitations
18# limitations under the License.19# under the License.
20
19"""21"""
20Reference implementation server for Glance Registry22Reference implementation server for Glance Registry
21"""23"""
2224
=== modified file 'doc/source/conf.py'
--- doc/source/conf.py 2011-01-27 01:17:54 +0000
+++ doc/source/conf.py 2011-01-27 20:06:13 +0000
@@ -77,9 +77,11 @@
77# built documents.77# built documents.
78#78#
79# The short X.Y version.79# The short X.Y version.
80version = '0.1'80from glance import version as glance_version
81# The full version, including alpha/beta/rc tags.81# The full version, including alpha/beta/rc tags.
82release = '0.1.6'82release = glance_version.version_string()
83# The short X.Y version.
84version = glance_version.canonical_version_string()
8385
84# The language for content autogenerated by Sphinx. Refer to documentation86# The language for content autogenerated by Sphinx. Refer to documentation
85# for a list of supported languages.87# for a list of supported languages.
@@ -118,7 +120,7 @@
118# A list of ignored prefixes for module index sorting.120# A list of ignored prefixes for module index sorting.
119modindex_common_prefix = ['glance.']121modindex_common_prefix = ['glance.']
120122
121# -- Options for man page output ----------------------------------------------123# -- Options for man page output --------------------------------------------
122124
123# Grouping the document tree for man pages.125# Grouping the document tree for man pages.
124# List of tuples 'sourcefile', 'target', u'title', u'Authors name', 'manual'126# List of tuples 'sourcefile', 'target', u'title', u'Authors name', 'manual'
125127
=== modified file 'glance/__init__.py'
--- glance/__init__.py 2010-09-27 22:43:04 +0000
+++ glance/__init__.py 2011-01-27 20:06:13 +0000
@@ -0,0 +1,16 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2010-2011 OpenStack LLC.
4# All Rights Reserved.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
017
=== modified file 'glance/client.py'
--- glance/client.py 2011-01-21 16:35:11 +0000
+++ glance/client.py 2011-01-27 20:06:13 +0000
@@ -1,6 +1,6 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=41# vim: tabstop=4 shiftwidth=4 softtabstop=4
22
3# Copyright 2010 OpenStack, LLC3# Copyright 2010-2011 OpenStack, LLC
4# All Rights Reserved.4# All Rights Reserved.
5#5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may6# Licensed under the Apache License, Version 2.0 (the "License"); you may
77
=== modified file 'glance/common/__init__.py'
--- glance/common/__init__.py 2010-09-29 00:20:11 +0000
+++ glance/common/__init__.py 2011-01-27 20:06:13 +0000
@@ -0,0 +1,16 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2010-2011 OpenStack LLC.
4# All Rights Reserved.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
017
=== modified file 'glance/common/db/__init__.py'
--- glance/common/db/__init__.py 2010-12-23 19:20:52 +0000
+++ glance/common/db/__init__.py 2011-01-27 20:06:13 +0000
@@ -1,8 +1,8 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=41# vim: tabstop=4 shiftwidth=4 softtabstop=4
2# vim: tabstop=4 shiftwidth=4 softtabstop=4
32
4# Copyright 2010 United States Government as represented by the3# Copyright 2010 United States Government as represented by the
5# Administrator of the National Aeronautics and Space Administration.4# Administrator of the National Aeronautics and Space Administration.
5# Copyright 2010-2011 OpenStack LLC.
6# All Rights Reserved.6# All Rights Reserved.
7#7#
8# Licensed under the Apache License, Version 2.0 (the "License"); you may8# Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -16,6 +16,7 @@
16# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the16# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17# License for the specific language governing permissions and limitations17# License for the specific language governing permissions and limitations
18# under the License.18# under the License.
19
19"""20"""
20DB abstraction for Nova and Glance21DB abstraction for Nova and Glance
21"""22"""
2223
=== modified file 'glance/common/db/sqlalchemy/__init__.py'
--- glance/common/db/sqlalchemy/__init__.py 2010-10-01 19:51:29 +0000
+++ glance/common/db/sqlalchemy/__init__.py 2011-01-27 20:06:13 +0000
@@ -0,0 +1,16 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2010-2011 OpenStack LLC.
4# All Rights Reserved.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
017
=== modified file 'glance/common/db/sqlalchemy/session.py'
--- glance/common/db/sqlalchemy/session.py 2010-10-15 05:35:15 +0000
+++ glance/common/db/sqlalchemy/session.py 2011-01-27 20:06:13 +0000
@@ -15,6 +15,7 @@
15# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the15# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16# License for the specific language governing permissions and limitations16# License for the specific language governing permissions and limitations
17# under the License.17# under the License.
18
18"""19"""
19Session Handling for SQLAlchemy backend20Session Handling for SQLAlchemy backend
20"""21"""
2122
=== modified file 'glance/registry/db/__init__.py'
--- glance/registry/db/__init__.py 2010-12-16 22:04:58 +0000
+++ glance/registry/db/__init__.py 2011-01-27 20:06:13 +0000
@@ -1,8 +1,8 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=41# vim: tabstop=4 shiftwidth=4 softtabstop=4
2# vim: tabstop=4 shiftwidth=4 softtabstop=4
32
4# Copyright 2010 United States Government as represented by the3# Copyright 2010 United States Government as represented by the
5# Administrator of the National Aeronautics and Space Administration.4# Administrator of the National Aeronautics and Space Administration.
5# Copyright 2010-2011 OpenStack LLC.
6# All Rights Reserved.6# All Rights Reserved.
7#7#
8# Licensed under the Apache License, Version 2.0 (the "License"); you may8# Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -16,6 +16,7 @@
16# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the16# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17# License for the specific language governing permissions and limitations17# License for the specific language governing permissions and limitations
18# under the License.18# under the License.
19
19"""20"""
20DB abstraction for Nova and Glance21DB abstraction for Nova and Glance
21"""22"""
2223
=== modified file 'glance/registry/db/api.py'
--- glance/registry/db/api.py 2010-12-14 02:23:42 +0000
+++ glance/registry/db/api.py 2011-01-27 20:06:13 +0000
@@ -2,6 +2,7 @@
22
3# Copyright 2010 United States Government as represented by the3# Copyright 2010 United States Government as represented by the
4# Administrator of the National Aeronautics and Space Administration.4# Administrator of the National Aeronautics and Space Administration.
5# Copyright 2010-2011 OpenStack LLC.
5# All Rights Reserved.6# All Rights Reserved.
6#7#
7# Licensed under the Apache License, Version 2.0 (the "License"); you may8# Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -15,6 +16,7 @@
15# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the16# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16# License for the specific language governing permissions and limitations17# License for the specific language governing permissions and limitations
17# under the License.18# under the License.
19
18"""20"""
19Defines interface for DB access21Defines interface for DB access
20"""22"""
2123
=== modified file 'glance/registry/db/sqlalchemy/api.py'
--- glance/registry/db/sqlalchemy/api.py 2011-01-22 19:15:55 +0000
+++ glance/registry/db/sqlalchemy/api.py 2011-01-27 20:06:13 +0000
@@ -2,6 +2,7 @@
22
3# Copyright 2010 United States Government as represented by the3# Copyright 2010 United States Government as represented by the
4# Administrator of the National Aeronautics and Space Administration.4# Administrator of the National Aeronautics and Space Administration.
5# Copyright 2011 OpenStack LLC.
5# All Rights Reserved.6# All Rights Reserved.
6#7#
7# Licensed under the Apache License, Version 2.0 (the "License"); you may8# Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -15,6 +16,7 @@
15# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the16# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16# License for the specific language governing permissions and limitations17# License for the specific language governing permissions and limitations
17# under the License.18# under the License.
19
18"""20"""
19Implementation of SQLAlchemy backend21Implementation of SQLAlchemy backend
20"""22"""
2123
=== modified file 'glance/registry/server.py'
--- glance/registry/server.py 2011-01-05 00:06:31 +0000
+++ glance/registry/server.py 2011-01-27 20:06:13 +0000
@@ -1,6 +1,6 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=41# vim: tabstop=4 shiftwidth=4 softtabstop=4
22
3# Copyright 2010 OpenStack LLC.3# Copyright 2010-2011 OpenStack LLC.
4# All Rights Reserved.4# All Rights Reserved.
5#5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may6# Licensed under the Apache License, Version 2.0 (the "License"); you may
77
=== added file 'glance/version.py'
--- glance/version.py 1970-01-01 00:00:00 +0000
+++ glance/version.py 2011-01-27 20:06:13 +0000
@@ -0,0 +1,46 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2011 OpenStack LLC
4#
5# Licensed under the Apache License, Version 2.0 (the "License"); you may
6# not use this file except in compliance with the License. You may obtain
7# a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14# License for the specific language governing permissions and limitations
15# under the License.
16
17try:
18 from glance.vcsversion import version_info
19except ImportError:
20 version_info = {'branch_nick': u'LOCALBRANCH',
21 'revision_id': 'LOCALREVISION',
22 'revno': 0}
23
24GLANCE_VERSION = ['2011', '2']
25YEAR, COUNT = GLANCE_VERSION
26
27FINAL = False # This becomes true at Release Candidate time
28
29
30def canonical_version_string():
31 return '.'.join([YEAR, COUNT])
32
33
34def version_string():
35 if FINAL:
36 return canonical_version_string()
37 else:
38 return '%s-dev' % (canonical_version_string(),)
39
40
41def vcs_version_string():
42 return "%s:%s" % (version_info['branch_nick'], version_info['revision_id'])
43
44
45def version_string_with_vcs():
46 return "%s-%s" % (canonical_version_string(), vcs_version_string())
047
=== modified file 'setup.py'
--- setup.py 2011-01-27 01:17:54 +0000
+++ setup.py 2011-01-27 20:06:13 +0000
@@ -20,6 +20,16 @@
20from setuptools import setup, find_packages20from setuptools import setup, find_packages
21from setuptools.command.sdist import sdist21from setuptools.command.sdist import sdist
2222
23from glance import version
24
25
26if os.path.isdir('.bzr'):
27 with open("glance/vcsversion.py", 'w') as version_file:
28 vcs_cmd = subprocess.Popen(["bzr", "version-info", "--python"],
29 stdout=subprocess.PIPE)
30 vcsversion = vcs_cmd.communicate()[0]
31 version_file.write(vcsversion)
32
2333
24class local_sdist(sdist):34class local_sdist(sdist):
25 """Customized sdist hook - builds the ChangeLog file from VC first"""35 """Customized sdist hook - builds the ChangeLog file from VC first"""
@@ -37,8 +47,12 @@
3747
38cmdclass = {'sdist': local_sdist}48cmdclass = {'sdist': local_sdist}
3949
50# If Sphinx is installed on the box running setup.py,
51# enable setup.py to build the documentation, otherwise,
52# just ignore it
40try:53try:
41 from sphinx.setup_command import BuildDoc54 from sphinx.setup_command import BuildDoc
55
42 class local_BuildDoc(BuildDoc):56 class local_BuildDoc(BuildDoc):
43 def run(self):57 def run(self):
44 for builder in ['html', 'man']:58 for builder in ['html', 'man']:
@@ -51,21 +65,19 @@
51 pass65 pass
5266
5367
54name = 'glance'
55version = '0.1.6'
56
57
58setup(68setup(
59 name=name,69 name='glance',
60 version=version,70 version=version.canonical_version_string(),
61 description='Glance',71 description='The Glance project provides services for discovering, '
72 'registering, and retrieving virtual machine images',
62 license='Apache License (2.0)',73 license='Apache License (2.0)',
63 author='OpenStack, LLC.',74 author='OpenStack',
64 author_email='openstack-admins@lists.launchpad.net',75 author_email='openstack@lists.launchpad.net',
65 url='https://launchpad.net/glance',76 url='http://glance.openstack.org/',
66 packages=find_packages(exclude=['tests', 'bin']),77 packages=find_packages(exclude=['tests', 'bin']),
67 test_suite='nose.collector',78 test_suite='nose.collector',
68 cmdclass=cmdclass,79 cmdclass=cmdclass,
80 include_package_data=True,
69 classifiers=[81 classifiers=[
70 'Development Status :: 4 - Beta',82 'Development Status :: 4 - Beta',
71 'License :: OSI Approved :: Apache Software License',83 'License :: OSI Approved :: Apache Software License',
@@ -73,7 +85,6 @@
73 'Programming Language :: Python :: 2.6',85 'Programming Language :: Python :: 2.6',
74 'Environment :: No Input/Output (Daemon)',86 'Environment :: No Input/Output (Daemon)',
75 ],87 ],
76 install_requires=[], # removed for better compat
77 scripts=['bin/glance-api',88 scripts=['bin/glance-api',
78 'bin/glance-registry',89 'bin/glance-registry',
79 'bin/glance-upload'])90 'bin/glance-upload'])
8091
=== modified file 'tests/__init__.py'
--- tests/__init__.py 2010-09-27 22:43:04 +0000
+++ tests/__init__.py 2011-01-27 20:06:13 +0000
@@ -0,0 +1,16 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2010-2011 OpenStack LLC.
4# All Rights Reserved.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
017
=== modified file 'tests/stubs.py'
--- tests/stubs.py 2011-01-26 16:51:08 +0000
+++ tests/stubs.py 2011-01-27 20:06:13 +0000
@@ -1,6 +1,6 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=41# vim: tabstop=4 shiftwidth=4 softtabstop=4
22
3# Copyright 2010 OpenStack, LLC3# Copyright 2010-2011 OpenStack, LLC
4# All Rights Reserved.4# All Rights Reserved.
5#5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may6# Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -136,7 +136,6 @@
136 def chunk_it():136 def chunk_it():
137 for i in xrange(0, len(cls.DATA), cls.CHUNK_SIZE):137 for i in xrange(0, len(cls.DATA), cls.CHUNK_SIZE):
138 yield cls.DATA[i:i + cls.CHUNK_SIZE]138 yield cls.DATA[i:i + cls.CHUNK_SIZE]
139
140 return chunk_it()139 return chunk_it()
141140
142 fake_swift_backend = FakeS3Backend()141 fake_swift_backend = FakeS3Backend()
@@ -202,8 +201,7 @@
202 DATA = \201 DATA = \
203 {'files': [202 {'files': [
204 {'location': 'file:///chunk0', 'size': 12345},203 {'location': 'file:///chunk0', 'size': 12345},
205 {'location': 'file:///chunk1', 'size': 1235}204 {'location': 'file:///chunk1', 'size': 1235}]}
206 ]}
207205
208 @classmethod206 @classmethod
209 def lookup(cls, _parsed_uri):207 def lookup(cls, _parsed_uri):
210208
=== modified file 'tests/unit/__init__.py'
--- tests/unit/__init__.py 2010-09-27 22:43:04 +0000
+++ tests/unit/__init__.py 2011-01-27 20:06:13 +0000
@@ -0,0 +1,16 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2010-2011 OpenStack LLC.
4# All Rights Reserved.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
017
=== modified file 'tests/unit/test_api.py'
--- tests/unit/test_api.py 2011-01-11 17:04:14 +0000
+++ tests/unit/test_api.py 2011-01-27 20:06:13 +0000
@@ -1,6 +1,6 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=41# vim: tabstop=4 shiftwidth=4 softtabstop=4
22
3# Copyright 2010 OpenStack, LLC3# Copyright 2010-2011 OpenStack, LLC
4# All Rights Reserved.4# All Rights Reserved.
5#5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may6# Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -88,8 +88,8 @@
88 'name': 'fake image #2',88 'name': 'fake image #2',
89 'is_public': True,89 'is_public': True,
90 'type': 'kernel',90 'type': 'kernel',
91 'status': 'active'91 'status': 'active'}
92 }92
93 req = webob.Request.blank('/images/detail')93 req = webob.Request.blank('/images/detail')
94 res = req.get_response(rserver.API())94 res = req.get_response(rserver.API())
95 res_dict = json.loads(res.body)95 res_dict = json.loads(res.body)
@@ -105,8 +105,7 @@
105 """Tests that the /images POST registry API creates the image"""105 """Tests that the /images POST registry API creates the image"""
106 fixture = {'name': 'fake public image',106 fixture = {'name': 'fake public image',
107 'is_public': True,107 'is_public': True,
108 'type': 'kernel'108 'type': 'kernel'}
109 }
110109
111 req = webob.Request.blank('/images')110 req = webob.Request.blank('/images')
112111
@@ -134,8 +133,7 @@
134 'name': 'fake public image',133 'name': 'fake public image',
135 'is_public': True,134 'is_public': True,
136 'type': 'kernel',135 'type': 'kernel',
137 'status': 'bad status'136 'status': 'bad status'}
138 }
139137
140 req = webob.Request.blank('/images')138 req = webob.Request.blank('/images')
141139
@@ -151,8 +149,7 @@
151 def test_update_image(self):149 def test_update_image(self):
152 """Tests that the /images PUT registry API updates the image"""150 """Tests that the /images PUT registry API updates the image"""
153 fixture = {'name': 'fake public image #2',151 fixture = {'name': 'fake public image #2',
154 'type': 'ramdisk'152 'type': 'ramdisk'}
155 }
156153
157 req = webob.Request.blank('/images/2')154 req = webob.Request.blank('/images/2')
158155
@@ -175,8 +172,7 @@
175 'name': 'fake public image',172 'name': 'fake public image',
176 'is_public': True,173 'is_public': True,
177 'type': 'kernel',174 'type': 'kernel',
178 'status': 'bad status'175 'status': 'bad status'}
179 }
180176
181 req = webob.Request.blank('/images/3')177 req = webob.Request.blank('/images/3')
182178
183179
=== modified file 'tests/unit/test_clients.py'
--- tests/unit/test_clients.py 2011-01-26 16:51:08 +0000
+++ tests/unit/test_clients.py 2011-01-27 20:06:13 +0000
@@ -1,6 +1,6 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=41# vim: tabstop=4 shiftwidth=4 softtabstop=4
22
3# Copyright 2010 OpenStack, LLC3# Copyright 2010-2011 OpenStack, LLC
4# All Rights Reserved.4# All Rights Reserved.
5#5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may6# Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -161,15 +161,13 @@
161 'type': 'kernel',161 'type': 'kernel',
162 'size': 19,162 'size': 19,
163 'location': "file:///tmp/glance-tests/2",163 'location': "file:///tmp/glance-tests/2",
164 'properties': {'distro': 'Ubuntu 10.04 LTS'}164 'properties': {'distro': 'Ubuntu 10.04 LTS'}}
165 }
166 expected = {'name': 'fake public image',165 expected = {'name': 'fake public image',
167 'is_public': True,166 'is_public': True,
168 'type': 'kernel',167 'type': 'kernel',
169 'size': 19,168 'size': 19,
170 'location': "file:///tmp/glance-tests/2",169 'location': "file:///tmp/glance-tests/2",
171 'properties': {'distro': 'Ubuntu 10.04 LTS'}170 'properties': {'distro': 'Ubuntu 10.04 LTS'}}
172 }
173171
174 new_image = self.client.add_image(fixture)172 new_image = self.client.add_image(fixture)
175173
@@ -216,8 +214,7 @@
216 def test_update_image(self):214 def test_update_image(self):
217 """Tests that the /images PUT registry API updates the image"""215 """Tests that the /images PUT registry API updates the image"""
218 fixture = {'name': 'fake public image #2',216 fixture = {'name': 'fake public image #2',
219 'type': 'ramdisk'217 'type': 'ramdisk'}
220 }
221218
222 self.assertTrue(self.client.update_image(2, fixture))219 self.assertTrue(self.client.update_image(2, fixture))
223220
@@ -233,7 +230,7 @@
233 'name': 'fake public image',230 'name': 'fake public image',
234 'is_public': True,231 'is_public': True,
235 'type': 'kernel',232 'type': 'kernel',
236 'status': 'bad status'233 'status': 'bad status',
237 }234 }
238235
239 self.assertRaises(exception.NotFound,236 self.assertRaises(exception.NotFound,
@@ -386,9 +383,8 @@
386 """Tests client returns image as queued"""383 """Tests client returns image as queued"""
387 fixture = {'name': 'fake public image',384 fixture = {'name': 'fake public image',
388 'is_public': True,385 'is_public': True,
389 'type': 'kernel'386 'type': 'kernel',
390 }387 }
391
392 image_meta = self.client.add_image(fixture)388 image_meta = self.client.add_image(fixture)
393 self.assertEquals('queued', image_meta['status'])389 self.assertEquals('queued', image_meta['status'])
394 self.assertEquals(0, image_meta['size'])390 self.assertEquals(0, image_meta['size'])
@@ -401,7 +397,6 @@
401 'size': 19,397 'size': 19,
402 'location': "file:///tmp/glance-tests/2",398 'location': "file:///tmp/glance-tests/2",
403 }399 }
404
405 new_image = self.client.add_image(fixture)400 new_image = self.client.add_image(fixture)
406 new_image_id = new_image['id']401 new_image_id = new_image['id']
407402
@@ -425,16 +420,15 @@
425 'type': 'kernel',420 'type': 'kernel',
426 'size': 19,421 'size': 19,
427 'location': "file:///tmp/glance-tests/2",422 'location': "file:///tmp/glance-tests/2",
428 'properties': {'distro': 'Ubuntu 10.04 LTS'}423 'properties': {'distro': 'Ubuntu 10.04 LTS'},
429 }424 }
430 expected = {'name': 'fake public image',425 expected = {'name': 'fake public image',
431 'is_public': True,426 'is_public': True,
432 'type': 'kernel',427 'type': 'kernel',
433 'size': 19,428 'size': 19,
434 'location': "file:///tmp/glance-tests/2",429 'location': "file:///tmp/glance-tests/2",
435 'properties': {'distro': 'Ubuntu 10.04 LTS'}430 'properties': {'distro': 'Ubuntu 10.04 LTS'},
436 }431 }
437
438 new_image = self.client.add_image(fixture)432 new_image = self.client.add_image(fixture)
439 new_image_id = new_image['id']433 new_image_id = new_image['id']
440434
@@ -485,7 +479,7 @@
485 'is_public': True,479 'is_public': True,
486 'type': 'kernel',480 'type': 'kernel',
487 'size': 19,481 'size': 19,
488 'properties': {'distro': 'Ubuntu 10.04 LTS'}482 'properties': {'distro': 'Ubuntu 10.04 LTS'},
489 }483 }
490484
491 image_data_fixture = r"chunk00000remainder"485 image_data_fixture = r"chunk00000remainder"
@@ -510,7 +504,7 @@
510 'is_public': True,504 'is_public': True,
511 'type': 'kernel',505 'type': 'kernel',
512 'size': 19,506 'size': 19,
513 'properties': {'distro': 'Ubuntu 10.04 LTS'}507 'properties': {'distro': 'Ubuntu 10.04 LTS'},
514 }508 }
515509
516 image_data_fixture = r"chunk00000remainder"510 image_data_fixture = r"chunk00000remainder"
@@ -546,7 +540,7 @@
546 fixture = {'name': 'fake public image',540 fixture = {'name': 'fake public image',
547 'is_public': True,541 'is_public': True,
548 'type': 'kernel',542 'type': 'kernel',
549 'properties': {'distro': 'Ubuntu 10.04 LTS'}543 'properties': {'distro': 'Ubuntu 10.04 LTS'},
550 }544 }
551545
552 image_data_fixture = r"chunk00000remainder"546 image_data_fixture = r"chunk00000remainder"
@@ -574,7 +568,7 @@
574 'type': 'kernel',568 'type': 'kernel',
575 'size': 19,569 'size': 19,
576 'store': 'bad',570 'store': 'bad',
577 'properties': {'distro': 'Ubuntu 10.04 LTS'}571 'properties': {'distro': 'Ubuntu 10.04 LTS'},
578 }572 }
579573
580 image_data_fixture = r"chunk00000remainder"574 image_data_fixture = r"chunk00000remainder"
@@ -587,7 +581,7 @@
587 def test_update_image(self):581 def test_update_image(self):
588 """Tests that the /images PUT registry API updates the image"""582 """Tests that the /images PUT registry API updates the image"""
589 fixture = {'name': 'fake public image #2',583 fixture = {'name': 'fake public image #2',
590 'type': 'ramdisk'584 'type': 'ramdisk',
591 }585 }
592586
593 self.assertTrue(self.client.update_image(2, fixture))587 self.assertTrue(self.client.update_image(2, fixture))
@@ -604,7 +598,7 @@
604 'name': 'fake public image',598 'name': 'fake public image',
605 'is_public': True,599 'is_public': True,
606 'type': 'kernel',600 'type': 'kernel',
607 'status': 'bad status'601 'status': 'bad status',
608 }602 }
609603
610 self.assertRaises(exception.NotFound,604 self.assertRaises(exception.NotFound,
611605
=== modified file 'tests/unit/test_registry_api.py'
--- tests/unit/test_registry_api.py 2011-01-11 17:04:14 +0000
+++ tests/unit/test_registry_api.py 2011-01-27 20:06:13 +0000
@@ -1,6 +1,6 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=41# vim: tabstop=4 shiftwidth=4 softtabstop=4
22
3# Copyright 2010 OpenStack, LLC3# Copyright 2010-2011 OpenStack, LLC
4# All Rights Reserved.4# All Rights Reserved.
5#5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may6# Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -80,7 +80,7 @@
80 'name': 'fake image #2',80 'name': 'fake image #2',
81 'is_public': True,81 'is_public': True,
82 'type': 'kernel',82 'type': 'kernel',
83 'status': 'active'83 'status': 'active',
84 }84 }
85 req = webob.Request.blank('/images/detail')85 req = webob.Request.blank('/images/detail')
86 res = req.get_response(server.API())86 res = req.get_response(server.API())
@@ -97,7 +97,7 @@
97 """Tests that the /images POST registry API creates the image"""97 """Tests that the /images POST registry API creates the image"""
98 fixture = {'name': 'fake public image',98 fixture = {'name': 'fake public image',
99 'is_public': True,99 'is_public': True,
100 'type': 'kernel'100 'type': 'kernel',
101 }101 }
102102
103 req = webob.Request.blank('/images')103 req = webob.Request.blank('/images')
@@ -126,7 +126,7 @@
126 'name': 'fake public image',126 'name': 'fake public image',
127 'is_public': True,127 'is_public': True,
128 'type': 'kernel',128 'type': 'kernel',
129 'status': 'bad status'129 'status': 'bad status',
130 }130 }
131131
132 req = webob.Request.blank('/images')132 req = webob.Request.blank('/images')
@@ -143,7 +143,7 @@
143 def test_update_image(self):143 def test_update_image(self):
144 """Tests that the /images PUT registry API updates the image"""144 """Tests that the /images PUT registry API updates the image"""
145 fixture = {'name': 'fake public image #2',145 fixture = {'name': 'fake public image #2',
146 'type': 'ramdisk'146 'type': 'ramdisk',
147 }147 }
148148
149 req = webob.Request.blank('/images/2')149 req = webob.Request.blank('/images/2')
@@ -167,7 +167,7 @@
167 'name': 'fake public image',167 'name': 'fake public image',
168 'is_public': True,168 'is_public': True,
169 'type': 'kernel',169 'type': 'kernel',
170 'status': 'bad status'170 'status': 'bad status',
171 }171 }
172172
173 req = webob.Request.blank('/images/3')173 req = webob.Request.blank('/images/3')
174174
=== modified file 'tests/unit/test_stores.py'
--- tests/unit/test_stores.py 2011-01-26 16:51:08 +0000
+++ tests/unit/test_stores.py 2011-01-27 20:06:13 +0000
@@ -1,6 +1,6 @@
1# vim: tabstop=4 shiftwidth=4 softtabstop=41# vim: tabstop=4 shiftwidth=4 softtabstop=4
22
3# Copyright 2010 OpenStack, LLC3# Copyright 2010-2011 OpenStack, LLC
4# All Rights Reserved.4# All Rights Reserved.
5#5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may6# Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -107,7 +107,6 @@
107107
108108
109class TestSwiftBackend(TestBackend):109class TestSwiftBackend(TestBackend):
110
111 def setUp(self):110 def setUp(self):
112 super(TestSwiftBackend, self).setUp()111 super(TestSwiftBackend, self).setUp()
113 stubs.stub_out_swift_backend(self.stubs)112 stubs.stub_out_swift_backend(self.stubs)
114113
=== modified file 'tools/install_venv.py'
--- tools/install_venv.py 2011-01-20 19:48:11 +0000
+++ tools/install_venv.py 2011-01-27 20:06:13 +0000
@@ -4,7 +4,7 @@
4# Administrator of the National Aeronautics and Space Administration.4# Administrator of the National Aeronautics and Space Administration.
5# All Rights Reserved.5# All Rights Reserved.
6#6#
7# Copyright 2010 OpenStack, LLC7# Copyright 2010 OpenStack LLC.
8#8#
9# Licensed under the Apache License, Version 2.0 (the "License"); you may9# Licensed under the Apache License, Version 2.0 (the "License"); you may
10# not use this file except in compliance with the License. You may obtain10# not use this file except in compliance with the License. You may obtain
@@ -33,7 +33,7 @@
3333
3434
35def die(message, *args):35def die(message, *args):
36 print >>sys.stderr, message % args36 print >> sys.stderr, message % args
37 sys.exit(1)37 sys.exit(1)
3838
3939

Subscribers

People subscribed via source and target branches