From 29f4be0f10f8ff771b1611bf8fa0f9403a7d4ab2 Mon Sep 17 00:00:00 2001 From: Bahtiar `kalkin-` Gadimov Date: Fri, 22 Apr 2016 15:40:36 +0200 Subject: [PATCH] If vm doesnt support volume_config raise TypeError --- qubes/vm/qubesvm.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qubes/vm/qubesvm.py b/qubes/vm/qubesvm.py index e0932292..6b5135ec 100644 --- a/qubes/vm/qubesvm.py +++ b/qubes/vm/qubesvm.py @@ -445,10 +445,14 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM): for name, conf in volume_config.items(): for k, v in conf.items(): self.volume_config[name][k] = v + elif volume_config: + raise TypeError( + 'volume_config specified, but {} did not expect that.' % + self.__class__.__name__) - import qubes.vm.adminvm # pylint: disable=redefined-outer-name + import qubes.vm.adminvm # pylint: disable=redefined-outer-name - #Init private attrs + # Init private attrs self._libvirt_domain = None self._qdb_connection = None