diff options
author | Matt Thode <prometheanfire@gentoo.org> | 2014-04-06 06:32:30 +0000 |
---|---|---|
committer | Matt Thode <prometheanfire@gentoo.org> | 2014-04-06 06:32:30 +0000 |
commit | e7b05b503be1f977f690afe7549097850b6b9756 (patch) | |
tree | 3ffc497dbb27d72a524d42dc89398d8b59b34b97 /sys-cluster | |
parent | 2013.2.3 (diff) | |
download | historical-e7b05b503be1f977f690afe7549097850b6b9756.tar.gz historical-e7b05b503be1f977f690afe7549097850b6b9756.tar.bz2 historical-e7b05b503be1f977f690afe7549097850b6b9756.zip |
2013.2.3
Package-Manager: portage-2.2.8-r1/cvs/Linux x86_64
Manifest-Sign-Key: 0x2471EB3E40AC5AC3
Diffstat (limited to 'sys-cluster')
-rw-r--r-- | sys-cluster/nova/ChangeLog | 9 | ||||
-rw-r--r-- | sys-cluster/nova/Manifest | 35 | ||||
-rw-r--r-- | sys-cluster/nova/files/2013.2.2-CVE-2014-0134.patch | 732 | ||||
-rw-r--r-- | sys-cluster/nova/nova-2013.2.3.ebuild (renamed from sys-cluster/nova/nova-2013.2.2-r1.ebuild) | 39 | ||||
-rw-r--r-- | sys-cluster/nova/nova-2013.2.9999.ebuild | 4 |
5 files changed, 41 insertions, 778 deletions
diff --git a/sys-cluster/nova/ChangeLog b/sys-cluster/nova/ChangeLog index 9d5e539a0861..fc37b78f545e 100644 --- a/sys-cluster/nova/ChangeLog +++ b/sys-cluster/nova/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-cluster/nova # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/nova/ChangeLog,v 1.57 2014/04/06 05:05:47 prometheanfire Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/nova/ChangeLog,v 1.58 2014/04/06 06:32:19 prometheanfire Exp $ + +*nova-2013.2.3 (06 Apr 2014) + + 06 Apr 2014; Matthew Thode <prometheanfire@gentoo.org> +nova-2013.2.3.ebuild, + -files/2013.2.2-CVE-2014-0134.patch, -nova-2013.2.2-r1.ebuild, + nova-2013.2.9999.ebuild: + 2013.2.3 06 Apr 2014; Matthew Thode <prometheanfire@gentoo.org> -nova-2013.1.5.ebuild, -nova-2013.1.9999.ebuild: diff --git a/sys-cluster/nova/Manifest b/sys-cluster/nova/Manifest index 41f6e6de6628..9d63196ba617 100644 --- a/sys-cluster/nova/Manifest +++ b/sys-cluster/nova/Manifest @@ -1,31 +1,30 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 -AUX 2013.2.2-CVE-2014-0134.patch 29323 SHA256 dd751e26c0d179603282cbfa8234d60756349db563b1b076db09d3f08fe92788 SHA512 74cfe95d4c35fc2456c55f38feb4481e18fef9141f1b1f4cf67958ba7505d068e3f4e36ad5b52a76d4a1b63d27e9a618d3721ea60d5d99a8fe3df89abaa93128 WHIRLPOOL 322a928c1be361904c3c30da13dc2885ff438fd16b9257292d800450e7e5d524cf7f8de68066b8683150c3ac97ecdfb81ff6b7bc7562b2a39f179b6674f298e0 AUX nova-confd 101 SHA256 d9013141618d1e8b8ba85297155747d9c8fc362238de7bba3108b9a2539c8c73 SHA512 4c7ec1d123f2cdaf394d1f4824df861bbe309b0b329db44080160d81746cd0fc9d4cc1b35da0f66ab075f1d4e835ababfb7bccaf4a2e931e60f2c0ac572a552e WHIRLPOOL 6a237357a3905d29a96b32c37f6d189e4f5cefc0986bb091e24a79295191332143741c604c2a9fd44484c75b3be89742a5570862cf0cd4ba225425f7f32b5348 AUX nova-initd 1496 SHA256 5b5f928335ac345103492555c3bc57407f547915b099762d0087aef172e5edf8 SHA512 cca06baba484d505f3a96643d836204a08e9dde50197531cdab2d95188b992a95a375a386b9c54fcc8e0a4f6167babba975db7510db1087f044afa39effe4eec WHIRLPOOL 4c667a5cc469826063a65879c1beddc98371edf295a273c9b8f679627cabfe2260d8b3bbdf9550d3894fc1525d63b9f98d6e939406f90ac5f2f745daa59311c2 AUX nova-sudoers 78 SHA256 9e88c2843fb74cc46802c0b103067ad12915ec50335d05e546a5dba76acb4a76 SHA512 22c0606c6335b2d1a03bd18a319a54f16f76f091b2e8416dbba05ce7c15890beff7f32f0322eb5ba3f2a5c750436cacbe0cee189b390b878e3f0c0df219ef984 WHIRLPOOL bc42ae1d12e9f900b263fd5c3d0f59062f46fbec1ff97c0bceb234082bea5943eb64795b4f5e102b8e2749c6868163e5924467088cad42df09345e3406e5f83c AUX nova.initd 537 SHA256 523587620208419cc73ea150ad1cc04502a2945e51970c3cae18bbfb1d328ce0 SHA512 c1bce2214e10e41e23d17034126c666d63fca5f7709d5bf93608778aa40d0ec518397151fec029b9be3b9639be66213b619f5a2a30617442ba07aff8335192b7 WHIRLPOOL 600946df334247c381bbf1d87e039e39bf3e2962afd5129a63751cd56ea348c804af50014f62141807e6f0181d74b7313f268834e5146b451b125e60cdb61643 -DIST nova-2013.2.2.tar.gz 6884905 SHA256 203bb5f7b773006bfbc4a946ae00e899896c27a21e73d1e4103bacc55bb83744 SHA512 6a1380204a22535a42c38f21efae8cf306d5d1c34da7997a1c9b3aebaa815c5e16d9cf6626e72575bbba3bba9dc93512ddc43a3f2d5bceac9dd518f409e9f14f WHIRLPOOL c620184e2d67e4ce726011ddcecc17ffdfec0e02934209feff891c3782c389cd9607ec393a9f3edd95905ea1da1ced18b9867e13cbdfed3a59a49d8336ee1e5a -EBUILD nova-2013.2.2-r1.ebuild 5133 SHA256 88a89a8476c994654563f862d3257e08802c398628c9fa45734524f93c678294 SHA512 130e6a2232255f470054b73b01f09903a329a1bbe9db61e118fa1a77058a3b0bab0e1b5e794831d4be58ccad8d904b8627758a6290fb9c56fa8b48b57054c85e WHIRLPOOL c66627ee4db02a3d1aed1025f427c3e1dd90d4684d03e2a585f5a9886251e414ebb57226202e811652d57edefd8e9fdb26c725aec290cc82356c5386b7446127 -EBUILD nova-2013.2.9999.ebuild 4518 SHA256 42627c742512560265a319926890550b727240879a7c72f9202c7622ed1c3631 SHA512 0da6abfdeec6b5c7c79947e2de096b753d2de5f3115faba9c894741975724b59f792e465aedcbd457c5667120f7c8fb5728f510d56ab5955e5af4cf0effb0d7b WHIRLPOOL 9c207b051fc867a11787fa2588ef549ea96e506a15f6d64eff29676b08a917b063e88db524958d5950b8b78253fe937d71ba23ae5beca9919529a9c7aff145ea +DIST nova-2013.2.3.tar.gz 6888463 SHA256 02902cb65b5adb0419c69cdb03ea2a0cfdfe8f7df342be44f3760d66cdecb61e SHA512 fd525e6f3f13e9405d4e53faaf44e88a3a4afe8491d9241edb6b66b61b9d8ec279dd0aead70ee5e6d166caf6879927fc01e57230d1129a7b2e2a794e32054570 WHIRLPOOL d4551136683595fd5ab831d692ab90a1aea177df4266341399726923ce285b6b7852705c89a516c146f88903d9a7fc4b3879419f158a68581144453f0fa36e8b +EBUILD nova-2013.2.3.ebuild 4496 SHA256 6f2d7a1897ec1593f204bc324b348e8effa32dee068c68498d72a6d321b737f1 SHA512 53a1aa6004253b79850c0c1702fc8c5ca382f6137504354ca096f11972657796010b17a8356b030d760b3dfc0711656bde6212d85369fcfa7a0d3740b7ac57e0 WHIRLPOOL 1f4a7cadd699496a72908ed0ef0a15bf7fcbd13dcab51cab61e95884442783994951064f8938fc81e9472e2d28bf3361331861bc381eaf6f2503f898ea073ce9 +EBUILD nova-2013.2.9999.ebuild 4518 SHA256 2967d09f391e940b6b7a698e84d769aa953c33138df8189fe901aabb8b1b151c SHA512 c92ce4b2f77d119a98d4634228a600bb93c902cb34dd2895377c70957f0f451128fc1079e451235ef6439358476377a0cb863a012e1a265995b57f174e866e66 WHIRLPOOL 0da414d998486d523f84f74b461e5f31dd5123b2dfe3fe5f3337e40b6dcdc78daade0d9af29d097e6ba38f671110e5f52f4bdd0635e4449f209cddf73c27b388 EBUILD nova-9999.ebuild 5225 SHA256 8336956c0a15fd17e15f748c6445c3b144f2a9047dd8257ba3dda7a7b7f1ad01 SHA512 6d961e646096eb4df5814d31b06352f999291becefa5e8fdd88afd14e6ede54e583ba224e474e1122e90b114da4136782cd8336afb467c61fc5400a7dd3a05e8 WHIRLPOOL c4bad3d35be8adb4af48562507ef213185e6d722541226e7d8bedd02578265c035874b371f432db4d1db222fc2776cc74374a508ca562a30dae622a86e0bab10 -MISC ChangeLog 13547 SHA256 d411ea85d65db429b26fe5810a52c440130f4fd42bd35c9a85b5ab2ebad09d36 SHA512 f0c1cc03860bde4522c335076a20d202643ed44acaf7b050e5a919767fd55f400eb785d539ce5b2016455a1e8781007a49e5c825e22ae7a11d6c4fc16203cf1f WHIRLPOOL 78b9c610139738b07c1b546ae85660b9a7972db7c1d92a7471601067d98908f7fa6f6e994a1a4a9d60618871e1e6140e9d39cdd84cfb491cbef0f9df07c5442f +MISC ChangeLog 13761 SHA256 9d734c1d1246caf0d23d770ff5ed61669a2e883f1132464791b078aba50571bf SHA512 39c7d0b15648c0e903b5b89ebc8d74bca539174ccef875c5abcf51f11642cc13896f97562ae3dd01aeeef787c195eddcad8e86f46c4a26ae90f2a7e9e60c9203 WHIRLPOOL c9b9f461ca6451e24d60098816434e9b84bcbdca65ccd61827ea202c940779d5dfcdcbd7bd86933c1ac98181ee7dbdb044bfc2b18ecdd1a74b2dab58d6ab5a71 MISC metadata.xml 1452 SHA256 29bf3efaab7a4e45f5e442b26a7606edaed3f47e4ffec3e8990f95aea6bf2450 SHA512 537664b6ff29f4afe09eb4635c2cb06d87a6c3c3101e8ef89d1ab9b5b802c79024e94a0cce5a44ec2fd5b1cc37a251dd42156a015b6a294f219b90daff17c9c1 WHIRLPOOL c6e44f9a48fea6ae2a323e9e03d8805301fb0d94bb5634b1946909715f6c05d45c49180204d00221aae1e6dc6748347b4273fae838216b5d5d07932bc473a851 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) -iQIcBAEBCAAGBQJTQODjAAoJECRx6z5ArFrD8IQP/ApN5LWZ3JO0mtsT/+sdQx99 -fve4TZysnZhUUXS/S2dqJ+kaxpjXMlr4tj8beZZ01I5ZWmNCi0xkvq6l5kOlrWhm -1wKwxquDf65ETXLKTkNX1tZICghpVZzotkCmVWzra79LU8WFb0D10yYCfESHK0Bu -3Uti8UB20AdG+rFvHyYNsQ+yrVNmPlHkyAEO6QxTPPCRJSTFP8SgThKuSdKbkOWh -mZOy/cuLPnjA7Fdx2R5e/sjIgKO3Jedj8/+416Hk7y1Xt/XVK73JdVD/qfDoNWj0 -Bp55w6v3ukKMQjokYaWSSsoV4SjX/7z/wLxumESC0FKoqM3giAh94HRSHdqyEadi -UA9AWdNl69cy7+I3cxp2z9k1+keF9xkRK8Vvw56jtb/vzsDE3t5kP+2tJmhuVI+Z -pRX3ZZee4gFSGSwId2ESluO37DElqPQ9g9QRwO9uhyXDrG0oXBW4qWWOZWS1hv1D -0iaPH3Lb9skdqi+BInoBhcUj/2dvFiTLspN2xtmoQSziVqwcY2xGnWaFm4yu6lnF -cBVXxGxjkVCVRXxmBPlCbDJ9UY7tNLLpog/gWMWwYRzZVjtVAn50plZQhvzhQ0Yd -rnG0H4HlDiKGAzowDkMS1g/R86kz6EGQC8NBNuZkNg907RITq2HBF+lKKY0fzE+J -XOsnGa9y01FdndMmmzBF -=RBYX +iQIcBAEBCAAGBQJTQPUuAAoJECRx6z5ArFrDkm0P+waMRudKtqarvFO2dqVyYwkC +bO5xPp+SZs2Me3uGoWRWJqxf9sqJ4z149IU2Fzx9+OIvyiD3+tAh1TV0CrtiAAoh +/caCTZkXv+8fHgqJHMpgNFHhSh3vtpylOMWprgOqlZAy52qq4GBZngwhbMaXjgHt +359gqy9B1ipy/AEIJjT0LKXOAGtBzSioMG03wagHhFdVwfZs+mWbGQubGfw35hr1 +6dk5Fy85yB9QqRgamlXuL13L/gqfJCHwzKMUMhgcYDuXlWdnUTB3MouhxxueBq9j +zNPFhf/S12U6Dc8pncnjHE0+uRpznEqUUbsYncAR9bV0qdQO/QfaQMMvOc6evCcS +Q2mk35ugc077DN117Dlor/Qv6+jSRKmRjGGIU6Sd9SxVRmSTHElzmjox3jXOQ2fa +syRQj8yn81um/VNurew0kFjC6+QL1JXthkw0vzC91gbg1BIJ4m/jZtKh8wBxvLHO +FKO9IaVkkK9pq03G/pyU+XxrrnI+c0uylmHDILaV1RAMwoMKCEvnluKRNOzKafTK +Bnu5qujZtgeKIw35qUi+018FCTH1QAEoK2Ll+jWVqaABrVSWxITUT71hK8TYg4uY +wHDG5cHjIttthU7WSeMMk/rzzokKkKQMEuG/LGMbsUPrwRjSK65Py2HAYjIcizCb +bH8dJYTvMIQkfkkFA6DS +=ZOTO -----END PGP SIGNATURE----- diff --git a/sys-cluster/nova/files/2013.2.2-CVE-2014-0134.patch b/sys-cluster/nova/files/2013.2.2-CVE-2014-0134.patch deleted file mode 100644 index 04d14cae392a..000000000000 --- a/sys-cluster/nova/files/2013.2.2-CVE-2014-0134.patch +++ /dev/null @@ -1,732 +0,0 @@ -From 25e761acd56d4c820273fc0245ada06c500c1637 Mon Sep 17 00:00:00 2001 -From: David Ripton <dripton@redhat.com> -Date: Tue, 28 Jan 2014 16:38:51 -0500 -Subject: [PATCH] Persist image format to a file, to prevent attacks based on - changing it - -The attack is based on creating a raw image that looks like a qcow2 -image, and taking advantage of the code that used 'qemu-img info' to -autodetect the image format. - -Now we store the image format to a 'disk.info' file, for Qcow2 and Raw -images, and only autodetect for images that have never been written to -that file. - -SecurityImpact - -Conflicts: - nova/virt/libvirt/imagebackend.py - -Manual tweaks to some mocking in test_imagebackend.py - -Change-Id: I2016efdb3f49a44ec4d677ac596eacc97871f30a -Co-authored-by: Nikola Dipanov <ndipanov@redhat.com> -Closes-bug: #1221190 ---- - nova/exception.py | 8 + - nova/tests/virt/libvirt/test_imagebackend.py | 359 ++++++++++++++++++++++----- - nova/tests/virt/libvirt/test_libvirt.py | 3 + - nova/tests/virt/test_virt_drivers.py | 7 + - nova/utils.py | 14 ++ - nova/virt/libvirt/imagebackend.py | 76 +++++- - 6 files changed, 403 insertions(+), 64 deletions(-) - -diff --git a/nova/exception.py b/nova/exception.py -index 7c17803..770a700 100644 ---- a/nova/exception.py -+++ b/nova/exception.py -@@ -449,6 +449,14 @@ class InvalidDiskFormat(Invalid): - msg_fmt = _("Disk format %(disk_format)s is not acceptable") - - -+class InvalidDiskInfo(Invalid): -+ msg_fmt = _("Disk info file is invalid: %(reason)s") -+ -+ -+class DiskInfoReadWriteFail(Invalid): -+ msg_fmt = _("Failed to read or write disk info file: %(reason)s") -+ -+ - class ImageUnacceptable(Invalid): - msg_fmt = _("Image %(image_id)s is unacceptable: %(reason)s") - -diff --git a/nova/tests/virt/libvirt/test_imagebackend.py b/nova/tests/virt/libvirt/test_imagebackend.py -index 5bfa94d..5424f7b 100644 ---- a/nova/tests/virt/libvirt/test_imagebackend.py -+++ b/nova/tests/virt/libvirt/test_imagebackend.py -@@ -16,6 +16,8 @@ - # under the License. - - import os -+import shutil -+import tempfile - - import fixtures - from oslo.config import cfg -@@ -27,13 +29,13 @@ - from nova import test - from nova.tests import fake_processutils - from nova.tests.virt.libvirt import fake_libvirt_utils -+from nova import utils - from nova.virt.libvirt import imagebackend - - CONF = cfg.CONF - - - class _ImageTestCase(object): -- INSTANCES_PATH = '/instances_path' - - def mock_create_image(self, image): - def create_image(fn, base, size, *args, **kwargs): -@@ -42,10 +44,13 @@ def create_image(fn, base, size, *args, **kwargs): - - def setUp(self): - super(_ImageTestCase, self).setUp() -+ self.INSTANCES_PATH = tempfile.mkdtemp(suffix='instances') - self.flags(disable_process_locking=True, - instances_path=self.INSTANCES_PATH) - self.INSTANCE = {'name': 'instance', - 'uuid': uuidutils.generate_uuid()} -+ self.DISK_INFO_PATH = os.path.join(self.INSTANCES_PATH, -+ self.INSTANCE['uuid'], 'disk.info') - self.NAME = 'fake.vm' - self.TEMPLATE = 'template' - -@@ -63,6 +68,78 @@ def setUp(self): - 'nova.virt.libvirt.imagebackend.libvirt_utils', - fake_libvirt_utils)) - -+ def fake_chown(path, owner_uid=None): -+ return None -+ self.stubs.Set(utils, 'chown', fake_chown) -+ -+ def tearDown(self): -+ super(_ImageTestCase, self).tearDown() -+ shutil.rmtree(self.INSTANCES_PATH) -+ -+ def test_prealloc_image(self): -+ CONF.set_override('preallocate_images', 'space') -+ -+ fake_processutils.fake_execute_clear_log() -+ fake_processutils.stub_out_processutils_execute(self.stubs) -+ image = self.image_class(self.INSTANCE, self.NAME) -+ -+ def fake_fetch(target, *args, **kwargs): -+ return -+ -+ self.stubs.Set(os.path, 'exists', lambda _: True) -+ self.stubs.Set(os, 'access', lambda p, w: True) -+ -+ # Call twice to verify testing fallocate is only called once. -+ image.cache(fake_fetch, self.TEMPLATE_PATH, self.SIZE) -+ image.cache(fake_fetch, self.TEMPLATE_PATH, self.SIZE) -+ -+ self.assertEqual(fake_processutils.fake_execute_get_log(), -+ ['fallocate -n -l 1 %s.fallocate_test' % self.PATH, -+ 'fallocate -n -l %s %s' % (self.SIZE, self.PATH), -+ 'fallocate -n -l %s %s' % (self.SIZE, self.PATH)]) -+ -+ def test_prealloc_image_without_write_access(self): -+ CONF.set_override('preallocate_images', 'space') -+ -+ fake_processutils.fake_execute_clear_log() -+ fake_processutils.stub_out_processutils_execute(self.stubs) -+ image = self.image_class(self.INSTANCE, self.NAME) -+ -+ def fake_fetch(target, *args, **kwargs): -+ return -+ -+ self.stubs.Set(image, 'check_image_exists', lambda: True) -+ self.stubs.Set(image, '_can_fallocate', lambda: True) -+ self.stubs.Set(os.path, 'exists', lambda _: True) -+ self.stubs.Set(os, 'access', lambda p, w: False) -+ -+ # Testing fallocate is only called when user has write access. -+ image.cache(fake_fetch, self.TEMPLATE_PATH, self.SIZE) -+ -+ self.assertEqual(fake_processutils.fake_execute_get_log(), []) -+ -+ -+class RawTestCase(_ImageTestCase, test.NoDBTestCase): -+ -+ SIZE = 1024 -+ -+ def setUp(self): -+ self.image_class = imagebackend.Raw -+ super(RawTestCase, self).setUp() -+ self.stubs.Set(imagebackend.Raw, 'correct_format', lambda _: None) -+ -+ def fake_chown(path, owner_uid=None): -+ return None -+ self.stubs.Set(utils, 'chown', fake_chown) -+ -+ def prepare_mocks(self): -+ fn = self.mox.CreateMockAnything() -+ self.mox.StubOutWithMock(imagebackend.utils.synchronized, -+ '__call__') -+ self.mox.StubOutWithMock(imagebackend.libvirt_utils, 'copy_image') -+ self.mox.StubOutWithMock(imagebackend.disk, 'extend') -+ return fn -+ - def test_cache(self): - self.mox.StubOutWithMock(os.path, 'exists') - if self.OLD_STYLE_INSTANCE_PATH: -@@ -130,66 +207,6 @@ def test_cache_template_exists(self): - - self.mox.VerifyAll() - -- def test_prealloc_image(self): -- CONF.set_override('preallocate_images', 'space') -- -- fake_processutils.fake_execute_clear_log() -- fake_processutils.stub_out_processutils_execute(self.stubs) -- image = self.image_class(self.INSTANCE, self.NAME) -- -- def fake_fetch(target, *args, **kwargs): -- return -- -- self.stubs.Set(os.path, 'exists', lambda _: True) -- self.stubs.Set(os, 'access', lambda p, w: True) -- -- # Call twice to verify testing fallocate is only called once. -- image.cache(fake_fetch, self.TEMPLATE_PATH, self.SIZE) -- image.cache(fake_fetch, self.TEMPLATE_PATH, self.SIZE) -- -- self.assertEqual(fake_processutils.fake_execute_get_log(), -- ['fallocate -n -l 1 %s.fallocate_test' % self.PATH, -- 'fallocate -n -l %s %s' % (self.SIZE, self.PATH), -- 'fallocate -n -l %s %s' % (self.SIZE, self.PATH)]) -- -- def test_prealloc_image_without_write_access(self): -- CONF.set_override('preallocate_images', 'space') -- -- fake_processutils.fake_execute_clear_log() -- fake_processutils.stub_out_processutils_execute(self.stubs) -- image = self.image_class(self.INSTANCE, self.NAME) -- -- def fake_fetch(target, *args, **kwargs): -- return -- -- self.stubs.Set(image, 'check_image_exists', lambda: True) -- self.stubs.Set(image, '_can_fallocate', lambda: True) -- self.stubs.Set(os.path, 'exists', lambda _: True) -- self.stubs.Set(os, 'access', lambda p, w: False) -- -- # Testing fallocate is only called when user has write access. -- image.cache(fake_fetch, self.TEMPLATE_PATH, self.SIZE) -- -- self.assertEqual(fake_processutils.fake_execute_get_log(), []) -- -- --class RawTestCase(_ImageTestCase, test.NoDBTestCase): -- -- SIZE = 1024 -- -- def setUp(self): -- self.image_class = imagebackend.Raw -- super(RawTestCase, self).setUp() -- self.stubs.Set(imagebackend.Raw, 'correct_format', lambda _: None) -- -- def prepare_mocks(self): -- fn = self.mox.CreateMockAnything() -- self.mox.StubOutWithMock(imagebackend.utils.synchronized, -- '__call__') -- self.mox.StubOutWithMock(imagebackend.libvirt_utils, 'copy_image') -- self.mox.StubOutWithMock(imagebackend.disk, 'extend') -- return fn -- - def test_create_image(self): - fn = self.prepare_mocks() - fn(target=self.TEMPLATE_PATH, max_size=None, image_id=None) -@@ -224,16 +241,21 @@ def test_create_image_extend(self): - self.mox.VerifyAll() - - def test_correct_format(self): -- info = self.mox.CreateMockAnything() - self.stubs.UnsetAll() - - self.mox.StubOutWithMock(os.path, 'exists') - self.mox.StubOutWithMock(imagebackend.images, 'qemu_img_info') - -+ def fake_chown(path, owner_uid=None): -+ return None -+ self.stubs.Set(utils, 'chown', fake_chown) -+ - os.path.exists(self.PATH).AndReturn(True) -+ os.path.exists(self.DISK_INFO_PATH).AndReturn(False) - info = self.mox.CreateMockAnything() - info.file_format = 'foo' - imagebackend.images.qemu_img_info(self.PATH).AndReturn(info) -+ os.path.exists(CONF.instances_path).AndReturn(True) - self.mox.ReplayAll() - - image = self.image_class(self.INSTANCE, self.NAME, path=self.PATH) -@@ -241,6 +263,11 @@ def test_correct_format(self): - - self.mox.VerifyAll() - -+ def test_resolve_driver_format(self): -+ image = self.image_class(self.INSTANCE, self.NAME) -+ driver_format = image.resolve_driver_format() -+ self.assertEqual(driver_format, 'raw') -+ - - class Qcow2TestCase(_ImageTestCase, test.NoDBTestCase): - SIZE = 1024 * 1024 * 1024 -@@ -251,6 +278,10 @@ def setUp(self): - self.QCOW2_BASE = (self.TEMPLATE_PATH + - '_%d' % (self.SIZE / (1024 * 1024 * 1024))) - -+ def fake_chown(path, owner_uid=None): -+ return None -+ self.stubs.Set(utils, 'chown', fake_chown) -+ - def prepare_mocks(self): - fn = self.mox.CreateMockAnything() - self.mox.StubOutWithMock(imagebackend.utils.synchronized, -@@ -261,6 +292,80 @@ def prepare_mocks(self): - self.mox.StubOutWithMock(imagebackend.disk, 'extend') - return fn - -+ def test_cache(self): -+ self.mox.StubOutWithMock(os.path, 'exists') -+ if self.OLD_STYLE_INSTANCE_PATH: -+ os.path.exists(self.OLD_STYLE_INSTANCE_PATH).AndReturn(False) -+ os.path.exists(self.DISK_INFO_PATH).AndReturn(False) -+ os.path.exists(CONF.instances_path).AndReturn(True) -+ os.path.exists(self.TEMPLATE_DIR).AndReturn(False) -+ os.path.exists(self.INSTANCES_PATH).AndReturn(True) -+ os.path.exists(self.PATH).AndReturn(False) -+ os.path.exists(self.TEMPLATE_PATH).AndReturn(False) -+ fn = self.mox.CreateMockAnything() -+ fn(target=self.TEMPLATE_PATH) -+ self.mox.ReplayAll() -+ -+ image = self.image_class(self.INSTANCE, self.NAME) -+ self.mock_create_image(image) -+ image.cache(fn, self.TEMPLATE) -+ -+ self.mox.VerifyAll() -+ -+ def test_cache_image_exists(self): -+ self.mox.StubOutWithMock(os.path, 'exists') -+ if self.OLD_STYLE_INSTANCE_PATH: -+ os.path.exists(self.OLD_STYLE_INSTANCE_PATH).AndReturn(False) -+ os.path.exists(self.DISK_INFO_PATH).AndReturn(False) -+ os.path.exists(self.INSTANCES_PATH).AndReturn(True) -+ os.path.exists(self.TEMPLATE_DIR).AndReturn(True) -+ os.path.exists(self.PATH).AndReturn(True) -+ os.path.exists(self.TEMPLATE_PATH).AndReturn(True) -+ self.mox.ReplayAll() -+ -+ image = self.image_class(self.INSTANCE, self.NAME) -+ image.cache(None, self.TEMPLATE) -+ -+ self.mox.VerifyAll() -+ -+ def test_cache_base_dir_exists(self): -+ self.mox.StubOutWithMock(os.path, 'exists') -+ if self.OLD_STYLE_INSTANCE_PATH: -+ os.path.exists(self.OLD_STYLE_INSTANCE_PATH).AndReturn(False) -+ os.path.exists(self.DISK_INFO_PATH).AndReturn(False) -+ os.path.exists(self.INSTANCES_PATH).AndReturn(True) -+ os.path.exists(self.TEMPLATE_DIR).AndReturn(True) -+ os.path.exists(self.PATH).AndReturn(False) -+ os.path.exists(self.TEMPLATE_PATH).AndReturn(False) -+ fn = self.mox.CreateMockAnything() -+ fn(target=self.TEMPLATE_PATH) -+ self.mox.ReplayAll() -+ -+ image = self.image_class(self.INSTANCE, self.NAME) -+ self.mock_create_image(image) -+ image.cache(fn, self.TEMPLATE) -+ -+ self.mox.VerifyAll() -+ -+ def test_cache_template_exists(self): -+ self.mox.StubOutWithMock(os.path, 'exists') -+ if self.OLD_STYLE_INSTANCE_PATH: -+ os.path.exists(self.OLD_STYLE_INSTANCE_PATH).AndReturn(False) -+ os.path.exists(self.DISK_INFO_PATH).AndReturn(False) -+ os.path.exists(self.INSTANCES_PATH).AndReturn(True) -+ os.path.exists(self.TEMPLATE_DIR).AndReturn(True) -+ os.path.exists(self.PATH).AndReturn(False) -+ os.path.exists(self.TEMPLATE_PATH).AndReturn(False) -+ fn = self.mox.CreateMockAnything() -+ fn(target=self.TEMPLATE_PATH) -+ self.mox.ReplayAll() -+ -+ image = self.image_class(self.INSTANCE, self.NAME) -+ self.mock_create_image(image) -+ image.cache(fn, self.TEMPLATE) -+ -+ self.mox.VerifyAll() -+ - def test_create_image(self): - fn = self.prepare_mocks() - fn(max_size=None, target=self.TEMPLATE_PATH) -@@ -279,6 +384,8 @@ def test_create_image_with_size(self): - self.mox.StubOutWithMock(os.path, 'exists') - if self.OLD_STYLE_INSTANCE_PATH: - os.path.exists(self.OLD_STYLE_INSTANCE_PATH).AndReturn(False) -+ os.path.exists(self.DISK_INFO_PATH).AndReturn(False) -+ os.path.exists(self.INSTANCES_PATH).AndReturn(True) - os.path.exists(self.TEMPLATE_PATH).AndReturn(False) - os.path.exists(self.PATH).AndReturn(False) - os.path.exists(self.PATH).AndReturn(False) -@@ -298,6 +405,8 @@ def test_create_image_too_small(self): - self.mox.StubOutWithMock(imagebackend.disk, 'get_disk_size') - if self.OLD_STYLE_INSTANCE_PATH: - os.path.exists(self.OLD_STYLE_INSTANCE_PATH).AndReturn(False) -+ os.path.exists(self.DISK_INFO_PATH).AndReturn(False) -+ os.path.exists(self.INSTANCES_PATH).AndReturn(True) - os.path.exists(self.TEMPLATE_PATH).AndReturn(True) - imagebackend.disk.get_disk_size(self.TEMPLATE_PATH - ).AndReturn(self.SIZE) -@@ -316,6 +425,8 @@ def test_generate_resized_backing_files(self): - 'get_disk_backing_file') - if self.OLD_STYLE_INSTANCE_PATH: - os.path.exists(self.OLD_STYLE_INSTANCE_PATH).AndReturn(False) -+ os.path.exists(self.DISK_INFO_PATH).AndReturn(False) -+ os.path.exists(CONF.instances_path).AndReturn(True) - os.path.exists(self.TEMPLATE_PATH).AndReturn(False) - os.path.exists(self.PATH).AndReturn(True) - -@@ -342,6 +453,9 @@ def test_qcow2_exists_and_has_no_backing_file(self): - 'get_disk_backing_file') - if self.OLD_STYLE_INSTANCE_PATH: - os.path.exists(self.OLD_STYLE_INSTANCE_PATH).AndReturn(False) -+ os.path.exists(self.DISK_INFO_PATH).AndReturn(False) -+ os.path.exists(self.INSTANCES_PATH).AndReturn(True) -+ - os.path.exists(self.TEMPLATE_PATH).AndReturn(False) - os.path.exists(self.PATH).AndReturn(True) - -@@ -355,6 +469,53 @@ def test_qcow2_exists_and_has_no_backing_file(self): - - self.mox.VerifyAll() - -+ def test_resolve_driver_format(self): -+ image = self.image_class(self.INSTANCE, self.NAME) -+ driver_format = image.resolve_driver_format() -+ self.assertEqual(driver_format, 'qcow2') -+ -+ def test_prealloc_image(self): -+ CONF.set_override('preallocate_images', 'space') -+ -+ fake_processutils.fake_execute_clear_log() -+ fake_processutils.stub_out_processutils_execute(self.stubs) -+ image = self.image_class(self.INSTANCE, self.NAME) -+ -+ def fake_fetch(target, *args, **kwargs): -+ return -+ -+ self.stubs.Set(os.path, 'exists', lambda _: True) -+ self.stubs.Set(os, 'access', lambda p, w: True) -+ -+ # Call twice to verify testing fallocate is only called once. -+ image.cache(fake_fetch, self.TEMPLATE_PATH, self.SIZE) -+ image.cache(fake_fetch, self.TEMPLATE_PATH, self.SIZE) -+ -+ self.assertEqual(fake_processutils.fake_execute_get_log(), -+ ['fallocate -n -l 1 %s.fallocate_test' % self.PATH, -+ 'fallocate -n -l %s %s' % (self.SIZE, self.PATH), -+ 'fallocate -n -l %s %s' % (self.SIZE, self.PATH)]) -+ -+ def test_prealloc_image_without_write_access(self): -+ CONF.set_override('preallocate_images', 'space') -+ -+ fake_processutils.fake_execute_clear_log() -+ fake_processutils.stub_out_processutils_execute(self.stubs) -+ image = self.image_class(self.INSTANCE, self.NAME) -+ -+ def fake_fetch(target, *args, **kwargs): -+ return -+ -+ self.stubs.Set(image, 'check_image_exists', lambda: True) -+ self.stubs.Set(image, '_can_fallocate', lambda: True) -+ self.stubs.Set(os.path, 'exists', lambda _: True) -+ self.stubs.Set(os, 'access', lambda p, w: False) -+ -+ # Testing fallocate is only called when user has write access. -+ image.cache(fake_fetch, self.TEMPLATE_PATH, self.SIZE) -+ -+ self.assertEqual(fake_processutils.fake_execute_get_log(), []) -+ - - class LvmTestCase(_ImageTestCase, test.NoDBTestCase): - VG = 'FakeVG' -@@ -431,6 +592,58 @@ def _create_image_resize(self, sparse): - - self.mox.VerifyAll() - -+ def test_cache(self): -+ self.mox.StubOutWithMock(os.path, 'exists') -+ if self.OLD_STYLE_INSTANCE_PATH: -+ os.path.exists(self.OLD_STYLE_INSTANCE_PATH).AndReturn(False) -+ os.path.exists(self.TEMPLATE_DIR).AndReturn(False) -+ os.path.exists(self.PATH).AndReturn(False) -+ os.path.exists(self.TEMPLATE_PATH).AndReturn(False) -+ -+ fn = self.mox.CreateMockAnything() -+ fn(target=self.TEMPLATE_PATH) -+ self.mox.StubOutWithMock(imagebackend.fileutils, 'ensure_tree') -+ imagebackend.fileutils.ensure_tree(self.TEMPLATE_DIR) -+ self.mox.ReplayAll() -+ -+ image = self.image_class(self.INSTANCE, self.NAME) -+ self.mock_create_image(image) -+ image.cache(fn, self.TEMPLATE) -+ -+ self.mox.VerifyAll() -+ -+ def test_cache_image_exists(self): -+ self.mox.StubOutWithMock(os.path, 'exists') -+ if self.OLD_STYLE_INSTANCE_PATH: -+ os.path.exists(self.OLD_STYLE_INSTANCE_PATH).AndReturn(False) -+ os.path.exists(self.TEMPLATE_DIR).AndReturn(True) -+ os.path.exists(self.PATH).AndReturn(True) -+ os.path.exists(self.TEMPLATE_PATH).AndReturn(True) -+ self.mox.ReplayAll() -+ -+ image = self.image_class(self.INSTANCE, self.NAME) -+ image.cache(None, self.TEMPLATE) -+ -+ self.mox.VerifyAll() -+ -+ def test_cache_base_dir_exists(self): -+ self.mox.StubOutWithMock(os.path, 'exists') -+ if self.OLD_STYLE_INSTANCE_PATH: -+ os.path.exists(self.OLD_STYLE_INSTANCE_PATH).AndReturn(False) -+ os.path.exists(self.TEMPLATE_DIR).AndReturn(True) -+ os.path.exists(self.PATH).AndReturn(False) -+ os.path.exists(self.TEMPLATE_PATH).AndReturn(False) -+ fn = self.mox.CreateMockAnything() -+ fn(target=self.TEMPLATE_PATH) -+ self.mox.StubOutWithMock(imagebackend.fileutils, 'ensure_tree') -+ self.mox.ReplayAll() -+ -+ image = self.image_class(self.INSTANCE, self.NAME) -+ self.mock_create_image(image) -+ image.cache(fn, self.TEMPLATE) -+ -+ self.mox.VerifyAll() -+ - def test_create_image(self): - self._create_image(False) - -@@ -596,6 +809,21 @@ def test_cache_template_exists(self): - - self.mox.VerifyAll() - -+ def test_cache_base_dir_exists(self): -+ self.mox.StubOutWithMock(os.path, 'exists') -+ os.path.exists(self.TEMPLATE_DIR).AndReturn(True) -+ os.path.exists(self.TEMPLATE_PATH).AndReturn(False) -+ fn = self.mox.CreateMockAnything() -+ fn(target=self.TEMPLATE_PATH) -+ self.mox.StubOutWithMock(imagebackend.fileutils, 'ensure_tree') -+ self.mox.ReplayAll() -+ -+ image = self.image_class(self.INSTANCE, self.NAME) -+ self.mock_create_image(image) -+ image.cache(fn, self.TEMPLATE) -+ -+ self.mox.VerifyAll() -+ - def test_create_image(self): - fn = self.prepare_mocks() - fn(max_size=None, rbd=self.rbd, target=self.TEMPLATE_PATH) -@@ -642,6 +870,13 @@ class BackendTestCase(test.NoDBTestCase): - 'uuid': uuidutils.generate_uuid()} - NAME = 'fake-name.suffix' - -+ def setUp(self): -+ super(BackendTestCase, self).setUp() -+ -+ def fake_chown(path, owner_uid=None): -+ return None -+ self.stubs.Set(utils, 'chown', fake_chown) -+ - def get_image(self, use_cow, image_type): - return imagebackend.Backend(use_cow).image(self.INSTANCE, - self.NAME, -diff --git a/nova/tests/virt/libvirt/test_libvirt.py b/nova/tests/virt/libvirt/test_libvirt.py -index ba842ad..ea8ac13 100644 ---- a/nova/tests/virt/libvirt/test_libvirt.py -+++ b/nova/tests/virt/libvirt/test_libvirt.py -@@ -390,6 +390,9 @@ def fake_extend(image, size, use_cow=False): - - self.stubs.Set(libvirt_driver.disk, 'extend', fake_extend) - -+ self.stubs.Set(imagebackend.Image, 'resolve_driver_format', -+ imagebackend.Image._get_driver_format) -+ - class FakeConn(): - def getCapabilities(self): - """Ensure standard capabilities being returned.""" -diff --git a/nova/tests/virt/test_virt_drivers.py b/nova/tests/virt/test_virt_drivers.py -index 832d9d6..8f1bd23 100644 ---- a/nova/tests/virt/test_virt_drivers.py -+++ b/nova/tests/virt/test_virt_drivers.py -@@ -30,6 +30,7 @@ - from nova.tests.virt.libvirt import fake_libvirt_utils - from nova.virt import event as virtevent - from nova.virt import fake -+from nova.virt.libvirt import imagebackend - - LOG = logging.getLogger(__name__) - -@@ -201,6 +202,12 @@ def setUp(self): - fake.FakeVirtAPI()) - self.ctxt = test_utils.get_test_admin_context() - self.image_service = fake_image.FakeImageService() -+ # NOTE(dripton): resolve_driver_format does some file reading and -+ # writing and chowning that complicate testing too much by requiring -+ # using real directories with proper permissions. Just stub it out -+ # here; we test it in test_imagebackend.py -+ self.stubs.Set(imagebackend.Image, 'resolve_driver_format', -+ imagebackend.Image._get_driver_format) - - def _get_running_instance(self): - instance_ref = test_utils.get_test_instance() -diff --git a/nova/utils.py b/nova/utils.py -index 599cb64..4757f3a 100755 ---- a/nova/utils.py -+++ b/nova/utils.py -@@ -924,6 +924,20 @@ def temporary_chown(path, owner_uid=None): - execute('chown', orig_uid, path, run_as_root=True) - - -+def chown(path, owner_uid=None): -+ """chown a path. -+ -+ :param owner_uid: UID of owner (defaults to current user) -+ """ -+ if owner_uid is None: -+ owner_uid = os.getuid() -+ -+ orig_uid = os.stat(path).st_uid -+ -+ if orig_uid != owner_uid: -+ execute('chown', owner_uid, path, run_as_root=True) -+ -+ - @contextlib.contextmanager - def tempdir(**kwargs): - argdict = kwargs.copy() -diff --git a/nova/virt/libvirt/imagebackend.py b/nova/virt/libvirt/imagebackend.py -index 51872cf..ed11c90 100644 ---- a/nova/virt/libvirt/imagebackend.py -+++ b/nova/virt/libvirt/imagebackend.py -@@ -88,6 +88,11 @@ def __init__(self, source_type, driver_format, is_block_dev=False): - self.is_block_dev = is_block_dev - self.preallocate = False - -+ # NOTE(dripton): We store lines of json (path, disk_format) in this -+ # file, for some image types, to prevent attacks based on changing the -+ # disk_format. -+ self.disk_info_path = None -+ - # NOTE(mikal): We need a lock directory which is shared along with - # instance files, to cover the scenario where multiple compute nodes - # are trying to create a base file at the same time -@@ -232,6 +237,65 @@ def snapshot_extract(self, target, out_format): - def snapshot_delete(self): - raise NotImplementedError() - -+ def _get_driver_format(self): -+ return self.driver_format -+ -+ def resolve_driver_format(self): -+ """Return the driver format for self.path. -+ -+ First checks self.disk_info_path for an entry. -+ If it's not there, calls self._get_driver_format(), and then -+ stores the result in self.disk_info_path -+ -+ See https://bugs.launchpad.net/nova/+bug/1221190 -+ """ -+ def _dict_from_line(line): -+ if not line: -+ return {} -+ try: -+ return jsonutils.loads(line) -+ except (TypeError, ValueError) as e: -+ msg = (_("Could not load line %(line)s, got error " -+ "%(error)s") % -+ {'line': line, 'error': unicode(e)}) -+ raise exception.InvalidDiskInfo(reason=msg) -+ -+ @utils.synchronized(self.disk_info_path, external=False, -+ lock_path=self.lock_path) -+ def write_to_disk_info_file(): -+ # Use os.open to create it without group or world write permission. -+ fd = os.open(self.disk_info_path, os.O_RDWR | os.O_CREAT, 0o644) -+ with os.fdopen(fd, "r+") as disk_info_file: -+ line = disk_info_file.read().rstrip() -+ dct = _dict_from_line(line) -+ if self.path in dct: -+ msg = _("Attempted overwrite of an existing value.") -+ raise exception.InvalidDiskInfo(reason=msg) -+ dct.update({self.path: driver_format}) -+ disk_info_file.seek(0) -+ disk_info_file.truncate() -+ disk_info_file.write('%s\n' % jsonutils.dumps(dct)) -+ # Ensure the file is always owned by the nova user so qemu can't -+ # write it. -+ utils.chown(self.disk_info_path, owner_uid=os.getuid()) -+ -+ try: -+ if (self.disk_info_path is not None and -+ os.path.exists(self.disk_info_path)): -+ with open(self.disk_info_path) as disk_info_file: -+ line = disk_info_file.read().rstrip() -+ dct = _dict_from_line(line) -+ for path, driver_format in dct.iteritems(): -+ if path == self.path: -+ return driver_format -+ driver_format = self._get_driver_format() -+ if self.disk_info_path is not None: -+ fileutils.ensure_tree(os.path.dirname(self.disk_info_path)) -+ write_to_disk_info_file() -+ except OSError as e: -+ raise exception.DiskInfoReadWriteFail(reason=unicode(e)) -+ return driver_format -+ - - class Raw(Image): - def __init__(self, instance=None, disk_name=None, path=None, -@@ -243,12 +307,17 @@ def __init__(self, instance=None, disk_name=None, path=None, - disk_name)) - self.snapshot_name = snapshot_name - self.preallocate = CONF.preallocate_images != 'none' -+ self.disk_info_path = os.path.join(os.path.dirname(self.path), -+ 'disk.info') - self.correct_format() - -+ def _get_driver_format(self): -+ data = images.qemu_img_info(self.path) -+ return data.file_format or 'raw' -+ - def correct_format(self): - if os.path.exists(self.path): -- data = images.qemu_img_info(self.path) -- self.driver_format = data.file_format or 'raw' -+ self.driver_format = self.resolve_driver_format() - - def create_image(self, prepare_template, base, size, *args, **kwargs): - @utils.synchronized(base, external=True, lock_path=self.lock_path) -@@ -291,6 +360,9 @@ def __init__(self, instance=None, disk_name=None, path=None, - disk_name)) - self.snapshot_name = snapshot_name - self.preallocate = CONF.preallocate_images != 'none' -+ self.disk_info_path = os.path.join(os.path.dirname(self.path), -+ 'disk.info') -+ self.resolve_driver_format() - - def create_image(self, prepare_template, base, size, *args, **kwargs): - @utils.synchronized(base, external=True, lock_path=self.lock_path) --- -1.8.5.5 - diff --git a/sys-cluster/nova/nova-2013.2.2-r1.ebuild b/sys-cluster/nova/nova-2013.2.3.ebuild index 917e62cd12d4..2571904f99ba 100644 --- a/sys-cluster/nova/nova-2013.2.2-r1.ebuild +++ b/sys-cluster/nova/nova-2013.2.3.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/nova/nova-2013.2.2-r1.ebuild,v 1.1 2014/03/25 20:51:33 prometheanfire Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/nova/nova-2013.2.3.ebuild,v 1.1 2014/04/06 06:32:19 prometheanfire Exp $ EAPI=5 PYTHON_COMPAT=( python2_7 ) @@ -14,7 +14,7 @@ SRC_URI="http://launchpad.net/${PN}/havana/${PV}/+download/${P}.tar.gz" LICENSE="Apache-2.0" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="+api +cert +compute +conductor +consoleauth +kvm +network +novncproxy +scheduler +spicehtml5proxy +xvpvncproxy sqlite mysql postgres xen" +IUSE="+compute +kvm +network +novncproxy sqlite mysql postgres xen" REQUIRED_USE="|| ( mysql postgres sqlite ) || ( kvm xen )" @@ -64,6 +64,7 @@ RDEPEND="sqlite? ( >=dev-python/sqlalchemy-0.7.8[sqlite,${PYTHON_USEDEP}] novncproxy? ( www-apps/novnc ) sys-apps/iproute2 net-misc/openvswitch + net-misc/rabbitmq-server sys-fs/sysfsutils sys-fs/multipath-tools kvm? ( app-emulation/qemu ) @@ -71,7 +72,6 @@ RDEPEND="sqlite? ( >=dev-python/sqlalchemy-0.7.8[sqlite,${PYTHON_USEDEP}] app-emulation/xen-tools )" PATCHES=( - "${FILESDIR}/2013.2.2-CVE-2014-0134.patch" ) pkg_setup() { @@ -81,47 +81,36 @@ pkg_setup() { python_install() { distutils-r1_python_install - newconfd "${FILESDIR}/nova-confd" "nova" - newinitd "${FILESDIR}/nova-initd" "nova" - use api && dosym /etc/init.d/nova /etc/init.d/nova-api - use cert && dosym /etc/init.d/nova /etc/init.d/nova-cert - use compute && dosym /etc/init.d/nova /etc/init.d/nova-compute - use conductor && dosym /etc/init.d/nova /etc/init.d/nova-conductor - use consoleauth && dosym /etc/init.d/nova /etc/init.d/nova-consoleauth - use network && dosym /etc/init.d/nova /etc/init.d/nova-network - use novncproxy &&dosym /etc/init.d/nova /etc/init.d/nova-novncproxy - use scheduler && dosym /etc/init.d/nova /etc/init.d/nova-scheduler - use spicehtml5proxy && dosym /etc/init.d/nova /etc/init.d/nova-spicehtml5proxy - use xvpvncproxy && dosym /etc/init.d/nova /etc/init.d/nova-xvpncproxy - diropts -m 0750 - dodir /var/run/nova /var/log/nova /var/lock/nova - fowners nova:nova /var/log/nova /var/lock/nova /var/run/nova + for svc in api cert compute conductor consoleauth network scheduler spicehtml5proxy xvpvncproxy; do + newinitd "${FILESDIR}/nova.initd" "nova-${svc}" + done + use compute && newinitd "${FILESDIR}/nova.initd" "nova-compute" + use novncproxy && newinitd "${FILESDIR}/nova.initd" "nova-novncproxy" - diropts -m 0755 - dodir /var/lib/nova/instances - fowners nova:nova /var/lib/nova/instances + diropts -m 0750 -o nova -g nova + dodir /var/log/nova /var/lib/nova/instances - keepdir /etc/nova insinto /etc/nova + insopts -m 0640 -o nova -g nova newins "etc/nova/nova.conf.sample" "nova.conf" doins "etc/nova/api-paste.ini" doins "etc/nova/logging_sample.conf" doins "etc/nova/policy.json" doins "etc/nova/rootwrap.conf" + #rootwrap filters insinto /etc/nova/rootwrap.d doins "etc/nova/rootwrap.d/api-metadata.filters" doins "etc/nova/rootwrap.d/compute.filters" doins "etc/nova/rootwrap.d/network.filters" - #copy migration conf file (not coppied on install via setup.py script) insinto /usr/$(get_libdir)/python2.7/site-packages/nova/db/sqlalchemy/migrate_repo/ doins "nova/db/sqlalchemy/migrate_repo/migrate.cfg" - #copy the CA cert dir (not coppied on install via setup.py script) - cp -R "${S}/nova/CA" "${D}/usr/$(get_libdir)/python2.7/site-packages/nova/" || die "isntalling CA files failed" + cp -R "${S}/nova/CA" "${D}/usr/$(get_libdir)/python2.7/site-packages/nova/" || die "installing CA files failed" #add sudoers definitions for user nova insinto /etc/sudoers.d/ + insopts -m 0600 -o root -g root doins "${FILESDIR}/nova-sudoers" } diff --git a/sys-cluster/nova/nova-2013.2.9999.ebuild b/sys-cluster/nova/nova-2013.2.9999.ebuild index 5326994f18e9..71685f993c32 100644 --- a/sys-cluster/nova/nova-2013.2.9999.ebuild +++ b/sys-cluster/nova/nova-2013.2.9999.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/nova/nova-2013.2.9999.ebuild,v 1.12 2014/04/01 03:46:51 prometheanfire Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/nova/nova-2013.2.9999.ebuild,v 1.13 2014/04/06 06:32:19 prometheanfire Exp $ EAPI=5 PYTHON_COMPAT=( python2_7 ) @@ -108,7 +108,7 @@ python_install() { insinto /usr/$(get_libdir)/python2.7/site-packages/nova/db/sqlalchemy/migrate_repo/ doins "nova/db/sqlalchemy/migrate_repo/migrate.cfg" #copy the CA cert dir (not coppied on install via setup.py script) - cp -R "${S}/nova/CA" "${D}/usr/$(get_libdir)/python2.7/site-packages/nova/" || die "isntalling CA files failed" + cp -R "${S}/nova/CA" "${D}/usr/$(get_libdir)/python2.7/site-packages/nova/" || die "installing CA files failed" #add sudoers definitions for user nova insinto /etc/sudoers.d/ |