Revision 0c505946
b/image_creator/image.py | ||
---|---|---|
118 | 118 |
self.enable() |
119 | 119 |
|
120 | 120 |
cls = os_cls(self.distro, self.ostype) |
121 |
self._os = cls(self.root, self.g, self.out)
|
|
121 |
self._os = cls(self) |
|
122 | 122 |
|
123 | 123 |
self._os.collect_metadata() |
124 | 124 |
|
b/image_creator/os_type/__init__.py | ||
---|---|---|
79 | 79 |
class OSBase(object): |
80 | 80 |
"""Basic operating system class""" |
81 | 81 |
|
82 |
def __init__(self, rootdev, ghandler, output): |
|
83 |
self.root = rootdev |
|
84 |
self.g = ghandler |
|
85 |
self.out = output |
|
82 |
def __init__(self, image): |
|
83 |
self.image = image |
|
84 |
|
|
85 |
self.root = image.root |
|
86 |
self.g = image.g |
|
87 |
self.out = image.out |
|
88 |
|
|
86 | 89 |
self.meta = {} |
87 | 90 |
|
88 | 91 |
def collect_metadata(self): |
b/image_creator/os_type/freebsd.py | ||
---|---|---|
42 | 42 |
|
43 | 43 |
class Freebsd(Unix): |
44 | 44 |
"""OS class for FreeBSD Unix-like os""" |
45 |
def __init__(self, rootdev, ghandler, output): |
|
46 |
super(Freebsd, self).__init__(rootdev, ghandler, output) |
|
47 | 45 |
|
48 | 46 |
@sysprep() |
49 | 47 |
def cleanup_password(self, print_header=True): |
b/image_creator/os_type/linux.py | ||
---|---|---|
43 | 43 |
|
44 | 44 |
class Linux(Unix): |
45 | 45 |
"""OS class for Linux""" |
46 |
def __init__(self, rootdev, ghandler, output):
|
|
47 |
super(Linux, self).__init__(rootdev, ghandler, output)
|
|
46 |
def __init__(self, image):
|
|
47 |
super(Linux, self).__init__(image)
|
|
48 | 48 |
self._uuid = dict() |
49 | 49 |
self._persistent = re.compile('/dev/[hsv]d[a-z][1-9]*') |
50 | 50 |
|
b/image_creator/os_type/ubuntu.py | ||
---|---|---|
40 | 40 |
|
41 | 41 |
class Ubuntu(Linux): |
42 | 42 |
"""OS class for Ubuntu Linux variants""" |
43 |
def __init__(self, rootdev, ghandler, output): |
|
44 |
super(Ubuntu, self).__init__(rootdev, ghandler, output) |
|
45 | 43 |
|
46 | 44 |
def _do_collect_metadata(self): |
47 | 45 |
"""Collect metadata about the OS""" |
Also available in: Unified diff