Revision 76d4a1c9 image_creator/main.py
b/image_creator/main.py | ||
---|---|---|
78 | 78 |
default=None, action="callback", callback=check_writable_dir, |
79 | 79 |
help="dump image to FILE", metavar="FILE") |
80 | 80 |
|
81 |
parser.add_option("--print-sysprep", dest="print_sysprep", default=False, |
|
82 |
help="Print the enabled and disable sysprep actions for this image", |
|
83 |
action="store_true") |
|
84 |
|
|
85 |
parser.add_option("--print-data-cleanup", dest="print_data_cleanup", |
|
86 |
default=False, help="Print the enabled and disable data cleanup " |
|
87 |
"operations actions for this source", action="store_true") |
|
88 |
|
|
81 | 89 |
parser.add_option("-s", "--silent", dest="silent", default=False, |
82 | 90 |
help="silent mode, only output error", action="store_true") |
83 | 91 |
|
... | ... | |
98 | 106 |
if options.register: |
99 | 107 |
options.upload = True |
100 | 108 |
|
101 |
if options.outfile is None and not options.upload: |
|
102 |
parser.error('either outfile (-o) or upload (-u) must be set.') |
|
103 |
|
|
104 | 109 |
return options |
105 | 110 |
|
106 | 111 |
|
... | ... | |
110 | 115 |
if options.silent: |
111 | 116 |
util.silent = True |
112 | 117 |
|
118 |
if options.outfile is None and not options.upload \ |
|
119 |
and not options.print_sysprep and not options.print_data_cleanup: |
|
120 |
FatalError("At least one of the following: `-o', `-u', " |
|
121 |
"`--print-sysprep' `--print-data-cleanup' must be set") |
|
122 |
|
|
113 | 123 |
output('snf-image-creator %s\n' % version) |
114 | 124 |
|
115 | 125 |
if os.geteuid() != 0: |
... | ... | |
134 | 144 |
|
135 | 145 |
output() |
136 | 146 |
|
147 |
if options.print_sysprep: |
|
148 |
image_os.print_sysprep() |
|
149 |
output() |
|
150 |
|
|
151 |
if options.print_data_cleanup: |
|
152 |
image_os.print_data_cleanup() |
|
153 |
output() |
|
154 |
|
|
155 |
if options.outfile is None and not options.upload: |
|
156 |
return 0 |
|
157 |
|
|
137 | 158 |
if options.sysprep: |
138 | 159 |
image_os.sysprep() |
139 | 160 |
|
Also available in: Unified diff