devices: add clone method

Copy DeviceAssignment object
This commit is contained in:
Marek Marczykowski-Górecki 2017-05-15 13:06:22 +02:00
parent b4ad5f0149
commit 8533ec9773
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -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.