Merge "Changes command to create the directory"

This commit is contained in:
Jenkins 2013-12-17 19:01:03 +00:00 committed by Gerrit Code Review
commit e20e29bf4b
2 changed files with 3 additions and 3 deletions

View File

@ -132,7 +132,7 @@ class VolumeMountPoint(object):
def mount(self):
if not os.path.exists(self.mount_point):
os.makedirs(self.mount_point)
utils.execute("sudo", "mkdir", "-p", self.mount_point)
LOG.debug("Adding volume. Device path:%s, mount_point:%s, "
"volume_type:%s, mount options:%s" %
(self.device_path, self.mount_point, self.volume_fstype,

View File

@ -161,12 +161,12 @@ class VolumeMountPointTest(testtools.TestCase):
os.path.exists = MagicMock(return_value=False)
fake_spawn = _setUp_fake_spawn()
os.makedirs = MagicMock()
utils.execute = Mock()
self.volumeMountPoint.mount()
self.assertEqual(1, os.path.exists.call_count)
self.assertEqual(1, os.makedirs.call_count)
self.assertEqual(1, utils.execute.call_count)
self.assertEqual(1, fake_spawn.expect.call_count)
os.path.exists = origin_