From f77c628b4f08a625bebe8b8b3bb24a8e9784a226 Mon Sep 17 00:00:00 2001 From: Miguel Herranz Date: Fri, 17 May 2019 12:53:10 +0200 Subject: [PATCH] Fix type error on call to mount device The call in nova.virt.disk.mount.api.Mount.mnt_dev() to nova.privsep.fs.mount() should include the `options` argument to fulfill with the method signature. The test test_do_mount_need_to_specify_fs_type has been modified to check that the caller use the correct signature. Closes-Bug: 1829506 Change-Id: Id14993db6ea33b2da14caa4b58671fc57c182706 Signed-off-by: Miguel Herranz (cherry picked from commit d2ef1ce309c28a5416af4cc00662ad6925574004) (cherry picked from commit 8371073ac7a3439ea5b6ce9091a91e77cf88020e) (cherry picked from commit e3cd1d9baa74181cbac1765291ad67654b35721d) --- nova/tests/unit/virt/disk/mount/test_nbd.py | 2 ++ nova/virt/disk/mount/api.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/nova/tests/unit/virt/disk/mount/test_nbd.py b/nova/tests/unit/virt/disk/mount/test_nbd.py index 2048766b2ced..fa56a2ebcec0 100644 --- a/nova/tests/unit/virt/disk/mount/test_nbd.py +++ b/nova/tests/unit/virt/disk/mount/test_nbd.py @@ -259,6 +259,8 @@ class NbdTestCase(test.NoDBTestCase): mount.map_dev = fake_returns_true self.assertFalse(mount.do_mount()) + mock_mount.assert_called_once_with( + None, None, tempdir, None) @mock.patch('nova.privsep.fs.nbd_connect') @mock.patch('nova.privsep.fs.nbd_disconnect') diff --git a/nova/virt/disk/mount/api.py b/nova/virt/disk/mount/api.py index 97ac6d2e2fba..a8585a0c9f51 100644 --- a/nova/virt/disk/mount/api.py +++ b/nova/virt/disk/mount/api.py @@ -248,7 +248,7 @@ class Mount(object): LOG.debug("Mount %(dev)s on %(dir)s", {'dev': self.mapped_device, 'dir': self.mount_dir}) out, err = nova.privsep.fs.mount(None, self.mapped_device, - self.mount_dir) + self.mount_dir, None) if err: self.error = _('Failed to mount filesystem: %s') % err LOG.debug(self.error)