Revision d415dda2 image_creator/os_type/__init__.py
b/image_creator/os_type/__init__.py | ||
---|---|---|
41 | 41 |
|
42 | 42 |
import textwrap |
43 | 43 |
import re |
44 |
from collections import namedtuple |
|
44 | 45 |
|
45 | 46 |
|
46 | 47 |
def os_cls(distro, osfamily): |
... | ... | |
79 | 80 |
class OSBase(object): |
80 | 81 |
"""Basic operating system class""" |
81 | 82 |
|
82 |
def __init__(self, image): |
|
83 |
SysprepParam = namedtuple('SysprepParam', |
|
84 |
'name description length validator') |
|
85 |
|
|
86 |
def __init__(self, image, **kargs): |
|
83 | 87 |
self.image = image |
84 | 88 |
|
85 | 89 |
self.root = image.root |
86 | 90 |
self.g = image.g |
87 | 91 |
self.out = image.out |
88 | 92 |
|
93 |
self.sysprep_params = \ |
|
94 |
kargs['sysprep_params'] if 'sysprep_params' in kargs else {} |
|
95 |
|
|
89 | 96 |
self.meta = {} |
90 | 97 |
|
91 | 98 |
def collect_metadata(self): |
... | ... | |
102 | 109 |
|
103 | 110 |
self.out.output() |
104 | 111 |
|
112 |
def needed_sysprep_params(self): |
|
113 |
"""Returns a list of needed sysprep parameters. Each element in the |
|
114 |
list is a SysprepParam object. |
|
115 |
""" |
|
116 |
return [] |
|
117 |
|
|
105 | 118 |
def list_syspreps(self): |
106 | 119 |
"""Returns a list of sysprep objects""" |
107 | 120 |
objs = [getattr(self, name) for name in dir(self) |
Also available in: Unified diff