Merge "Changes command to create the directory"
This commit is contained in:
commit
e20e29bf4b
@ -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,
|
||||
|
@ -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_
|
||||
|
Loading…
x
Reference in New Issue
Block a user