diff --git a/bin/glance-api b/bin/glance-api index 576eb8b488..bddb8bca1a 100755 --- a/bin/glance-api +++ b/bin/glance-api @@ -5,17 +5,17 @@ # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Glance API Server diff --git a/bin/glance-registry b/bin/glance-registry index 8a5878b9e1..62c4980179 100755 --- a/bin/glance-registry +++ b/bin/glance-registry @@ -3,19 +3,21 @@ # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. +# Copyright 2011 OpenStack LLC. # All Rights Reserved. # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """ Reference implementation server for Glance Registry """ diff --git a/doc/source/conf.py b/doc/source/conf.py index 70138f60dd..e3d0232477 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -120,7 +120,7 @@ pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. modindex_common_prefix = ['glance.'] -# -- Options for man page output ---------------------------------------------- +# -- Options for man page output -------------------------------------------- # Grouping the document tree for man pages. # List of tuples 'sourcefile', 'target', u'title', u'Authors name', 'manual' diff --git a/glance/__init__.py b/glance/__init__.py index e69de29bb2..b60695702c 100644 --- a/glance/__init__.py +++ b/glance/__init__.py @@ -0,0 +1,16 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010-2011 OpenStack LLC. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. diff --git a/glance/client.py b/glance/client.py index 4260512b24..8d0ac3de89 100644 --- a/glance/client.py +++ b/glance/client.py @@ -1,6 +1,6 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright 2010 OpenStack, LLC +# Copyright 2010-2011 OpenStack, LLC # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may diff --git a/glance/common/__init__.py b/glance/common/__init__.py index e69de29bb2..b60695702c 100644 --- a/glance/common/__init__.py +++ b/glance/common/__init__.py @@ -0,0 +1,16 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010-2011 OpenStack LLC. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. diff --git a/glance/common/db/__init__.py b/glance/common/db/__init__.py index fe6422cbd6..13b461acfc 100644 --- a/glance/common/db/__init__.py +++ b/glance/common/db/__init__.py @@ -1,8 +1,8 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. +# Copyright 2010-2011 OpenStack LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -16,6 +16,7 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. + """ DB abstraction for Nova and Glance """ diff --git a/glance/common/db/sqlalchemy/__init__.py b/glance/common/db/sqlalchemy/__init__.py index e69de29bb2..b60695702c 100644 --- a/glance/common/db/sqlalchemy/__init__.py +++ b/glance/common/db/sqlalchemy/__init__.py @@ -0,0 +1,16 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010-2011 OpenStack LLC. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. diff --git a/glance/common/db/sqlalchemy/session.py b/glance/common/db/sqlalchemy/session.py index 41cf14f29f..4fd03762c4 100644 --- a/glance/common/db/sqlalchemy/session.py +++ b/glance/common/db/sqlalchemy/session.py @@ -15,6 +15,7 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. + """ Session Handling for SQLAlchemy backend """ diff --git a/glance/registry/db/__init__.py b/glance/registry/db/__init__.py index 27e796769a..c73cf36a28 100644 --- a/glance/registry/db/__init__.py +++ b/glance/registry/db/__init__.py @@ -1,8 +1,8 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. +# Copyright 2010-2011 OpenStack LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -16,6 +16,7 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. + """ DB abstraction for Nova and Glance """ diff --git a/glance/registry/db/api.py b/glance/registry/db/api.py index 2b99eeaf69..9b802e6c47 100644 --- a/glance/registry/db/api.py +++ b/glance/registry/db/api.py @@ -2,6 +2,7 @@ # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. +# Copyright 2010-2011 OpenStack LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -15,6 +16,7 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. + """ Defines interface for DB access """ diff --git a/glance/registry/db/sqlalchemy/api.py b/glance/registry/db/sqlalchemy/api.py index b15af1d617..42fc6c3b9f 100644 --- a/glance/registry/db/sqlalchemy/api.py +++ b/glance/registry/db/sqlalchemy/api.py @@ -2,6 +2,7 @@ # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. +# Copyright 2011 OpenStack LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -15,6 +16,7 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. + """ Implementation of SQLAlchemy backend """ diff --git a/glance/registry/server.py b/glance/registry/server.py index baeceae9f7..6c77de8121 100644 --- a/glance/registry/server.py +++ b/glance/registry/server.py @@ -1,6 +1,6 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright 2010 OpenStack LLC. +# Copyright 2010-2011 OpenStack LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may diff --git a/tests/__init__.py b/tests/__init__.py index e69de29bb2..b60695702c 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -0,0 +1,16 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010-2011 OpenStack LLC. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. diff --git a/tests/stubs.py b/tests/stubs.py index e4fef6b075..d9716db972 100644 --- a/tests/stubs.py +++ b/tests/stubs.py @@ -1,6 +1,6 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright 2010 OpenStack, LLC +# Copyright 2010-2011 OpenStack, LLC # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -136,7 +136,6 @@ def stub_out_s3_backend(stubs): def chunk_it(): for i in xrange(0, len(cls.DATA), cls.CHUNK_SIZE): yield cls.DATA[i:i + cls.CHUNK_SIZE] - return chunk_it() fake_swift_backend = FakeS3Backend() @@ -202,8 +201,7 @@ def stub_out_registry(stubs): DATA = \ {'files': [ {'location': 'file:///chunk0', 'size': 12345}, - {'location': 'file:///chunk1', 'size': 1235} - ]} + {'location': 'file:///chunk1', 'size': 1235}]} @classmethod def lookup(cls, _parsed_uri): diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py index e69de29bb2..b60695702c 100644 --- a/tests/unit/__init__.py +++ b/tests/unit/__init__.py @@ -0,0 +1,16 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010-2011 OpenStack LLC. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. diff --git a/tests/unit/test_api.py b/tests/unit/test_api.py index 73adb145ba..f3fdf4f1ef 100644 --- a/tests/unit/test_api.py +++ b/tests/unit/test_api.py @@ -1,6 +1,6 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright 2010 OpenStack, LLC +# Copyright 2010-2011 OpenStack, LLC # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -88,8 +88,8 @@ class TestRegistryAPI(unittest.TestCase): 'name': 'fake image #2', 'is_public': True, 'type': 'kernel', - 'status': 'active' - } + 'status': 'active'} + req = webob.Request.blank('/images/detail') res = req.get_response(rserver.API()) res_dict = json.loads(res.body) @@ -105,8 +105,7 @@ class TestRegistryAPI(unittest.TestCase): """Tests that the /images POST registry API creates the image""" fixture = {'name': 'fake public image', 'is_public': True, - 'type': 'kernel' - } + 'type': 'kernel'} req = webob.Request.blank('/images') @@ -134,8 +133,7 @@ class TestRegistryAPI(unittest.TestCase): 'name': 'fake public image', 'is_public': True, 'type': 'kernel', - 'status': 'bad status' - } + 'status': 'bad status'} req = webob.Request.blank('/images') @@ -151,8 +149,7 @@ class TestRegistryAPI(unittest.TestCase): def test_update_image(self): """Tests that the /images PUT registry API updates the image""" fixture = {'name': 'fake public image #2', - 'type': 'ramdisk' - } + 'type': 'ramdisk'} req = webob.Request.blank('/images/2') @@ -175,8 +172,7 @@ class TestRegistryAPI(unittest.TestCase): 'name': 'fake public image', 'is_public': True, 'type': 'kernel', - 'status': 'bad status' - } + 'status': 'bad status'} req = webob.Request.blank('/images/3') diff --git a/tests/unit/test_clients.py b/tests/unit/test_clients.py index 977be9efc3..5858c599a9 100644 --- a/tests/unit/test_clients.py +++ b/tests/unit/test_clients.py @@ -1,6 +1,6 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright 2010 OpenStack, LLC +# Copyright 2010-2011 OpenStack, LLC # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -161,15 +161,13 @@ class TestRegistryClient(unittest.TestCase): 'type': 'kernel', 'size': 19, 'location': "file:///tmp/glance-tests/2", - 'properties': {'distro': 'Ubuntu 10.04 LTS'} - } + 'properties': {'distro': 'Ubuntu 10.04 LTS'}} expected = {'name': 'fake public image', 'is_public': True, 'type': 'kernel', 'size': 19, 'location': "file:///tmp/glance-tests/2", - 'properties': {'distro': 'Ubuntu 10.04 LTS'} - } + 'properties': {'distro': 'Ubuntu 10.04 LTS'}} new_image = self.client.add_image(fixture) @@ -216,8 +214,7 @@ class TestRegistryClient(unittest.TestCase): def test_update_image(self): """Tests that the /images PUT registry API updates the image""" fixture = {'name': 'fake public image #2', - 'type': 'ramdisk' - } + 'type': 'ramdisk'} self.assertTrue(self.client.update_image(2, fixture)) @@ -233,7 +230,7 @@ class TestRegistryClient(unittest.TestCase): 'name': 'fake public image', 'is_public': True, 'type': 'kernel', - 'status': 'bad status' + 'status': 'bad status', } self.assertRaises(exception.NotFound, @@ -386,9 +383,8 @@ class TestClient(unittest.TestCase): """Tests client returns image as queued""" fixture = {'name': 'fake public image', 'is_public': True, - 'type': 'kernel' + 'type': 'kernel', } - image_meta = self.client.add_image(fixture) self.assertEquals('queued', image_meta['status']) self.assertEquals(0, image_meta['size']) @@ -401,7 +397,6 @@ class TestClient(unittest.TestCase): 'size': 19, 'location': "file:///tmp/glance-tests/2", } - new_image = self.client.add_image(fixture) new_image_id = new_image['id'] @@ -425,16 +420,15 @@ class TestClient(unittest.TestCase): 'type': 'kernel', 'size': 19, 'location': "file:///tmp/glance-tests/2", - 'properties': {'distro': 'Ubuntu 10.04 LTS'} + 'properties': {'distro': 'Ubuntu 10.04 LTS'}, } expected = {'name': 'fake public image', 'is_public': True, 'type': 'kernel', 'size': 19, 'location': "file:///tmp/glance-tests/2", - 'properties': {'distro': 'Ubuntu 10.04 LTS'} + 'properties': {'distro': 'Ubuntu 10.04 LTS'}, } - new_image = self.client.add_image(fixture) new_image_id = new_image['id'] @@ -485,7 +479,7 @@ class TestClient(unittest.TestCase): 'is_public': True, 'type': 'kernel', 'size': 19, - 'properties': {'distro': 'Ubuntu 10.04 LTS'} + 'properties': {'distro': 'Ubuntu 10.04 LTS'}, } image_data_fixture = r"chunk00000remainder" @@ -510,7 +504,7 @@ class TestClient(unittest.TestCase): 'is_public': True, 'type': 'kernel', 'size': 19, - 'properties': {'distro': 'Ubuntu 10.04 LTS'} + 'properties': {'distro': 'Ubuntu 10.04 LTS'}, } image_data_fixture = r"chunk00000remainder" @@ -546,7 +540,7 @@ class TestClient(unittest.TestCase): fixture = {'name': 'fake public image', 'is_public': True, 'type': 'kernel', - 'properties': {'distro': 'Ubuntu 10.04 LTS'} + 'properties': {'distro': 'Ubuntu 10.04 LTS'}, } image_data_fixture = r"chunk00000remainder" @@ -574,7 +568,7 @@ class TestClient(unittest.TestCase): 'type': 'kernel', 'size': 19, 'store': 'bad', - 'properties': {'distro': 'Ubuntu 10.04 LTS'} + 'properties': {'distro': 'Ubuntu 10.04 LTS'}, } image_data_fixture = r"chunk00000remainder" @@ -587,7 +581,7 @@ class TestClient(unittest.TestCase): def test_update_image(self): """Tests that the /images PUT registry API updates the image""" fixture = {'name': 'fake public image #2', - 'type': 'ramdisk' + 'type': 'ramdisk', } self.assertTrue(self.client.update_image(2, fixture)) @@ -604,7 +598,7 @@ class TestClient(unittest.TestCase): 'name': 'fake public image', 'is_public': True, 'type': 'kernel', - 'status': 'bad status' + 'status': 'bad status', } self.assertRaises(exception.NotFound, diff --git a/tests/unit/test_registry_api.py b/tests/unit/test_registry_api.py index 9740c329c2..36ef5c02fe 100644 --- a/tests/unit/test_registry_api.py +++ b/tests/unit/test_registry_api.py @@ -1,6 +1,6 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright 2010 OpenStack, LLC +# Copyright 2010-2011 OpenStack, LLC # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -80,7 +80,7 @@ class TestImageController(unittest.TestCase): 'name': 'fake image #2', 'is_public': True, 'type': 'kernel', - 'status': 'active' + 'status': 'active', } req = webob.Request.blank('/images/detail') res = req.get_response(server.API()) @@ -97,7 +97,7 @@ class TestImageController(unittest.TestCase): """Tests that the /images POST registry API creates the image""" fixture = {'name': 'fake public image', 'is_public': True, - 'type': 'kernel' + 'type': 'kernel', } req = webob.Request.blank('/images') @@ -126,7 +126,7 @@ class TestImageController(unittest.TestCase): 'name': 'fake public image', 'is_public': True, 'type': 'kernel', - 'status': 'bad status' + 'status': 'bad status', } req = webob.Request.blank('/images') @@ -143,7 +143,7 @@ class TestImageController(unittest.TestCase): def test_update_image(self): """Tests that the /images PUT registry API updates the image""" fixture = {'name': 'fake public image #2', - 'type': 'ramdisk' + 'type': 'ramdisk', } req = webob.Request.blank('/images/2') @@ -167,7 +167,7 @@ class TestImageController(unittest.TestCase): 'name': 'fake public image', 'is_public': True, 'type': 'kernel', - 'status': 'bad status' + 'status': 'bad status', } req = webob.Request.blank('/images/3') diff --git a/tests/unit/test_stores.py b/tests/unit/test_stores.py index b281c43353..599ec4465a 100644 --- a/tests/unit/test_stores.py +++ b/tests/unit/test_stores.py @@ -1,6 +1,6 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright 2010 OpenStack, LLC +# Copyright 2010-2011 OpenStack, LLC # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -107,7 +107,6 @@ class TestS3Backend(TestBackend): class TestSwiftBackend(TestBackend): - def setUp(self): super(TestSwiftBackend, self).setUp() stubs.stub_out_swift_backend(self.stubs) diff --git a/tools/install_venv.py b/tools/install_venv.py index da76d0c123..0234ce739c 100644 --- a/tools/install_venv.py +++ b/tools/install_venv.py @@ -4,7 +4,7 @@ # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # -# Copyright 2010 OpenStack, LLC +# Copyright 2010 OpenStack LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain @@ -33,7 +33,7 @@ PIP_REQUIRES = os.path.join(ROOT, 'tools', 'pip-requires') def die(message, *args): - print >>sys.stderr, message % args + print >> sys.stderr, message % args sys.exit(1)