From 8533ec97730a2b242be1d2cda16fe2204d902325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 15 May 2017 13:06:22 +0200 Subject: [PATCH] devices: add clone method Copy DeviceAssignment object --- qubes/devices.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/qubes/devices.py b/qubes/devices.py index fdc929c4..0b4f4708 100644 --- a/qubes/devices.py +++ b/qubes/devices.py @@ -80,6 +80,17 @@ class DeviceAssignment(object): # pylint: disable=too-few-public-methods return self.backend_domain == other.backend_domain \ and self.ident == other.ident + def clone(self): + '''Clone object instance''' + return self.__class__( + self.backend_domain, + self.ident, + self.options, + self.persistent, + self.frontend_domain + ) + + class DeviceCollection(object): '''Bag for devices.