From 2f4616c2be4fb03864c74cdbb1d1ec9b2bdbf235 Mon Sep 17 00:00:00 2001 From: Michael Still Date: Sun, 13 Jan 2013 09:27:48 +1100 Subject: Convert ConfigDriveHelper to being a context manager itself. This is a little bit less awkward than the previous implementation, and is based on a suggestion from Padraig Brady. Change-Id: If8b09a41d21777a4bd56af16e1f7e02d61d1dd4e --- nova/tests/test_configdrive2.py | 4 ++-- nova/tests/test_virt_drivers.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'nova/tests') diff --git a/nova/tests/test_configdrive2.py b/nova/tests/test_configdrive2.py index 91c2a4e5e..260ab28c7 100644 --- a/nova/tests/test_configdrive2.py +++ b/nova/tests/test_configdrive2.py @@ -45,7 +45,7 @@ class ConfigDriveTestCase(test.TestCase): self.mox.ReplayAll() - with configdrive.config_drive_helper() as c: + with configdrive.ConfigDriveBuilder() as c: c._add_file('this/is/a/path/hello', 'This is some content') (fd, imagefile) = tempfile.mkstemp(prefix='cd_iso_') os.close(fd) @@ -77,7 +77,7 @@ class ConfigDriveTestCase(test.TestCase): self.mox.ReplayAll() - with configdrive.config_drive_helper() as c: + with configdrive.ConfigDriveBuilder() as c: c._add_file('this/is/a/path/hello', 'This is some content') (fd, imagefile) = tempfile.mkstemp(prefix='cd_vfat_') os.close(fd) diff --git a/nova/tests/test_virt_drivers.py b/nova/tests/test_virt_drivers.py index 9e9309dfe..199ae30b1 100644 --- a/nova/tests/test_virt_drivers.py +++ b/nova/tests/test_virt_drivers.py @@ -114,7 +114,7 @@ class _FakeDriverBackendTestCase(object): # We can't actually make a config drive v2 because ensure_tree has # been faked out - self.stubs.Set(nova.virt.configdrive._ConfigDriveBuilder, + self.stubs.Set(nova.virt.configdrive.ConfigDriveBuilder, 'make_drive', fake_make_drive) def _teardown_fakelibvirt(self): -- cgit