Commit 2e50092b authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Make os_type list_sysprep method return 1 list

The method used to return 2 lists of enabled and disabled sysprep
object. Since sysprep objs contail an `enabled' attribute, it is easy
to determine which of those are enabled and which are not. There is
no need to return 2 seperate lists.
parent 3251a62c
......@@ -90,10 +90,7 @@ class OSBase(object):
objs = [getattr(self, name) for name in dir(self) \
if not name.startswith('_')]
enabled = [x for x in objs if self._is_sysprep(x) and x.enabled]
disabled = [x for x in objs if self._is_sysprep(x) and not x.enabled]
return enabled, disabled
return [x for x in objs if self._is_sysprep(x)]
def _sysprep_change_status(self, name, status):
......@@ -123,7 +120,9 @@ class OSBase(object):
def print_syspreps(self):
"""Print enabled and disabled system preperation operations."""
enabled, disabled = self.list_syspreps()
syspreps = self.list_syspreps()
enabled = filter(lambda x: x.enabled, syspreps)
disabled = filter(lambda x: not x.enabled, syspreps)
wrapper = textwrap.TextWrapper()
wrapper.subsequent_indent = '\t'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment