From 8d5714512a4172f9d11c0243dc4b054681dbe1f3 Mon Sep 17 00:00:00 2001 From: mulhern Date: Tue, 24 Feb 2015 11:13:21 -0500 Subject: [PATCH] Add a little utility method for constructing task objects. Signed-off-by: mulhern --- blivet/formats/fs.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py index 65acf6fdf..40fba02a7 100644 --- a/blivet/formats/fs.py +++ b/blivet/formats/fs.py @@ -87,6 +87,11 @@ def __init__(self, **kwargs): that you can specify the device at the last moment by specifying it via the 'device' kwarg to the :meth:`create` method. """ + + def getTaskObject(klass): + # pylint: disable=not-callable + return klass(self) if klass is not None else None + if self.__class__ is FS: raise TypeError("FS is an abstract class.")