From 11191ea6940dfe05897ab3a899a176b91de59e5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 4 Sep 2016 20:55:07 +0200 Subject: [PATCH] Fix core2migration and tests for new devices API QubesOS/qubes-issues#2257 --- qubes/core2migration.py | 7 ++++--- qubes/tests/int/backup.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/qubes/core2migration.py b/qubes/core2migration.py index 01ecbf07..bea22ac7 100644 --- a/qubes/core2migration.py +++ b/qubes/core2migration.py @@ -187,12 +187,12 @@ class Core2Qubes(qubes.Qubes): services = ast.literal_eval(services) else: services = {} - for service, value in services.iteritems(): + for service, value in services.items(): feature = service for repl_feature, repl_service in \ qubes.ext.r3compatibility.\ R3Compatibility.features_to_services.\ - iteritems(): + items(): if repl_service == service: feature = repl_feature vm.features[feature] = value @@ -205,7 +205,8 @@ class Core2Qubes(qubes.Qubes): pcidevs = ast.literal_eval(pcidevs) for pcidev in pcidevs: try: - vm.devices["pci"].attach(pcidev) + vm.devices["pci"].attach( + self.domains[0].devices['pci'][pcidev]) except qubes.exc.QubesException as e: self.log.error("VM {}: {}".format(vm.name, str(e))) except (ValueError, LookupError) as err: diff --git a/qubes/tests/int/backup.py b/qubes/tests/int/backup.py index db29c2b3..7caae244 100644 --- a/qubes/tests/int/backup.py +++ b/qubes/tests/int/backup.py @@ -67,7 +67,7 @@ class TC_00_Backup(qubes.tests.BackupTestsMixin, qubes.tests.QubesTestCase): self.assertEquals(orig_value, restored_value, "VM {} - property {} not properly restored".format( vm.name, prop)) - for dev_class in ["pci", "usb"]: + for dev_class in vm.devices.keys(): for dev in vm.devices[dev_class]: self.assertIn(dev, restored_vm.devices[dev_class])