Revision d9aff2ae
b/image_creator/main.py | ||
---|---|---|
121 | 121 |
"input media", default=[], action="append", |
122 | 122 |
metavar="SYSPREP") |
123 | 123 |
|
124 |
parser.add_option("--print-sysprep-params", dest="print_sysprep_params", |
|
125 |
default=False, help="print the needed sysprep parameters" |
|
126 |
" for this input media", action="store_true") |
|
127 |
|
|
124 | 128 |
parser.add_option("--sysprep-param", dest="sysprep_params", default=[], |
125 | 129 |
help="Add KEY=VALUE system preparation parameter", |
126 | 130 |
action="append") |
... | ... | |
191 | 195 |
options = parse_options(sys.argv[1:]) |
192 | 196 |
|
193 | 197 |
if options.outfile is None and not options.upload and not \ |
194 |
options.print_sysprep: |
|
195 |
raise FatalError("At least one of `-o', `-u' or `--print-sysprep' "
|
|
196 |
"must be set") |
|
198 |
options.print_sysprep and not options.print_sysprep_params:
|
|
199 |
raise FatalError("At least one of `-o', `-u', `--print-sysprep' or "
|
|
200 |
"`--print-sysprep-params' must be set")
|
|
197 | 201 |
|
198 | 202 |
if options.silent: |
199 | 203 |
out = SilentOutput() |
... | ... | |
279 | 283 |
image.os.print_syspreps() |
280 | 284 |
out.output() |
281 | 285 |
|
286 |
if options.print_sysprep_params: |
|
287 |
image.os.print_sysprep_params() |
|
288 |
out.output() |
|
289 |
|
|
282 | 290 |
if options.outfile is None and not options.upload: |
283 | 291 |
return 0 |
284 | 292 |
|
b/image_creator/os_type/__init__.py | ||
---|---|---|
183 | 183 |
descr = wrapper.fill(textwrap.dedent(sysprep.__doc__)) |
184 | 184 |
self.out.output(' %s:\n%s\n' % (name, descr)) |
185 | 185 |
|
186 |
def print_sysprep_params(self): |
|
187 |
"""Print the system preparation parameter the user may use""" |
|
188 |
|
|
189 |
self.out.output("Needed system preparation parameters:") |
|
190 |
|
|
191 |
params = self.needed_sysprep_params() |
|
192 |
|
|
193 |
if len(params) == 0: |
|
194 |
self.out.output("(none)") |
|
195 |
return |
|
196 |
|
|
197 |
for param in params: |
|
198 |
self.out.output("\t%s (%s): %s" % |
|
199 |
(param.description, param.name, |
|
200 |
self.sysprep_params[param.name] if param.name in |
|
201 |
self.sysprep_params else "(none)")) |
|
202 |
|
|
186 | 203 |
def do_sysprep(self): |
187 | 204 |
"""Prepare system for image creation.""" |
188 | 205 |
|
Also available in: Unified diff