self.enable()
cls = os_cls(self.distro, self.ostype)
- self._os = cls(self.root, self.g, self.out)
+ self._os = cls(self)
self._os.collect_metadata()
class OSBase(object):
"""Basic operating system class"""
- def __init__(self, rootdev, ghandler, output):
- self.root = rootdev
- self.g = ghandler
- self.out = output
+ def __init__(self, image):
+ self.image = image
+
+ self.root = image.root
+ self.g = image.g
+ self.out = image.out
+
self.meta = {}
def collect_metadata(self):
class Freebsd(Unix):
"""OS class for FreeBSD Unix-like os"""
- def __init__(self, rootdev, ghandler, output):
- super(Freebsd, self).__init__(rootdev, ghandler, output)
@sysprep()
def cleanup_password(self, print_header=True):
class Linux(Unix):
"""OS class for Linux"""
- def __init__(self, rootdev, ghandler, output):
- super(Linux, self).__init__(rootdev, ghandler, output)
+ def __init__(self, image):
+ super(Linux, self).__init__(image)
self._uuid = dict()
self._persistent = re.compile('/dev/[hsv]d[a-z][1-9]*')
class Ubuntu(Linux):
"""OS class for Ubuntu Linux variants"""
- def __init__(self, rootdev, ghandler, output):
- super(Ubuntu, self).__init__(rootdev, ghandler, output)
def _do_collect_metadata(self):
"""Collect metadata about the OS"""