From: Nikos Skalkotos Date: Fri, 19 Jul 2013 08:09:24 +0000 (+0300) Subject: Make sysprep_info return a named tuple X-Git-Tag: 0.5~1^2~13^2~17 X-Git-Url: https://code.grnet.gr/git/snf-image-creator/commitdiff_plain/17649dd681e2d2f1c98ca8764cc77043740c9e97 Make sysprep_info return a named tuple It used to return a tuple --- diff --git a/image_creator/os_type/__init__.py b/image_creator/os_type/__init__.py index e41c52c..3ac92be 100644 --- a/image_creator/os_type/__init__.py +++ b/image_creator/os_type/__init__.py @@ -138,7 +138,10 @@ class OSBase(object): """Returns information about a sysprep object""" assert self._is_sysprep(obj), "Object is not a sysprep" - return (obj.__name__.replace('_', '-'), textwrap.dedent(obj.__doc__)) + SysprepInfo = namedtuple("SysprepInfo", "name description") + + return SysprepInfo(obj.__name__.replace('_', '-'), + textwrap.dedent(obj.__doc__)) def get_sysprep_by_name(self, name): """Returns the sysprep object with the given name"""