From a73334b47a88e6b1c0f33db5312edd49d50c097b Mon Sep 17 00:00:00 2001 From: Michael Still Date: Mon, 27 Aug 2012 13:17:36 +1000 Subject: Port existing code to utils.ensure_tree Now that we have ensure_tree in utils, port most users of os.makedirs() to use it. Change-Id: I3256cbb76bd889f99f1e6f3367bd620645f828a1 --- nova/tests/network/test_linux_net.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'nova/tests') diff --git a/nova/tests/network/test_linux_net.py b/nova/tests/network/test_linux_net.py index 47b853a8a..fd6708343 100644 --- a/nova/tests/network/test_linux_net.py +++ b/nova/tests/network/test_linux_net.py @@ -236,18 +236,18 @@ class LinuxNetworkTestCase(test.TestCase): self.flags(use_single_default_gateway=True) self.mox.StubOutWithMock(self.driver, 'write_to_file') - self.mox.StubOutWithMock(self.driver, 'ensure_path') + self.mox.StubOutWithMock(utils, 'ensure_tree') self.mox.StubOutWithMock(os, 'chmod') self.driver.write_to_file(mox.IgnoreArg(), mox.IgnoreArg()) self.driver.write_to_file(mox.IgnoreArg(), mox.IgnoreArg()) - self.driver.ensure_path(mox.IgnoreArg()) - self.driver.ensure_path(mox.IgnoreArg()) - self.driver.ensure_path(mox.IgnoreArg()) - self.driver.ensure_path(mox.IgnoreArg()) - self.driver.ensure_path(mox.IgnoreArg()) - self.driver.ensure_path(mox.IgnoreArg()) - self.driver.ensure_path(mox.IgnoreArg()) + utils.ensure_tree(mox.IgnoreArg()) + utils.ensure_tree(mox.IgnoreArg()) + utils.ensure_tree(mox.IgnoreArg()) + utils.ensure_tree(mox.IgnoreArg()) + utils.ensure_tree(mox.IgnoreArg()) + utils.ensure_tree(mox.IgnoreArg()) + utils.ensure_tree(mox.IgnoreArg()) os.chmod(mox.IgnoreArg(), mox.IgnoreArg()) os.chmod(mox.IgnoreArg(), mox.IgnoreArg()) @@ -259,18 +259,18 @@ class LinuxNetworkTestCase(test.TestCase): self.flags(use_single_default_gateway=True) self.mox.StubOutWithMock(self.driver, 'write_to_file') - self.mox.StubOutWithMock(self.driver, 'ensure_path') + self.mox.StubOutWithMock(utils, 'ensure_tree') self.mox.StubOutWithMock(os, 'chmod') self.driver.write_to_file(mox.IgnoreArg(), mox.IgnoreArg()) self.driver.write_to_file(mox.IgnoreArg(), mox.IgnoreArg()) - self.driver.ensure_path(mox.IgnoreArg()) - self.driver.ensure_path(mox.IgnoreArg()) - self.driver.ensure_path(mox.IgnoreArg()) - self.driver.ensure_path(mox.IgnoreArg()) - self.driver.ensure_path(mox.IgnoreArg()) - self.driver.ensure_path(mox.IgnoreArg()) - self.driver.ensure_path(mox.IgnoreArg()) + utils.ensure_tree(mox.IgnoreArg()) + utils.ensure_tree(mox.IgnoreArg()) + utils.ensure_tree(mox.IgnoreArg()) + utils.ensure_tree(mox.IgnoreArg()) + utils.ensure_tree(mox.IgnoreArg()) + utils.ensure_tree(mox.IgnoreArg()) + utils.ensure_tree(mox.IgnoreArg()) os.chmod(mox.IgnoreArg(), mox.IgnoreArg()) os.chmod(mox.IgnoreArg(), mox.IgnoreArg()) -- cgit