Revision 923d52df image_creator/disk.py
b/image_creator/disk.py | ||
---|---|---|
205 | 205 |
|
206 | 206 |
def enable(self): |
207 | 207 |
"""Enable a newly created DiskDevice""" |
208 |
self.progressbar = self.out.Progress(100, "Launching helper VM", |
|
209 |
"percent") |
|
210 |
eh = self.g.set_event_callback(self.progress_callback, |
|
211 |
guestfs.EVENT_PROGRESS) |
|
208 |
|
|
209 |
self.out.output('Launching helper VM (may take a while) ...', False) |
|
210 |
# self.progressbar = self.out.Progress(100, "Launching helper VM", |
|
211 |
# "percent") |
|
212 |
# eh = self.g.set_event_callback(self.progress_callback, |
|
213 |
# guestfs.EVENT_PROGRESS) |
|
212 | 214 |
self.g.launch() |
213 | 215 |
self.guestfs_enabled = True |
214 |
self.g.delete_event_callback(eh) |
|
215 |
self.progressbar.success('done') |
|
216 |
self.progressbar = None |
|
216 |
# self.g.delete_event_callback(eh) |
|
217 |
# self.progressbar.success('done') |
|
218 |
# self.progressbar = None |
|
219 |
self.out.success('done') |
|
217 | 220 |
|
218 | 221 |
self.out.output('Inspecting Operating System ...', False) |
219 | 222 |
roots = self.g.inspect_os() |
... | ... | |
244 | 247 |
# Close the guestfs handler if open |
245 | 248 |
self.g.close() |
246 | 249 |
|
247 |
def progress_callback(self, ev, eh, buf, array): |
|
248 |
position = array[2] |
|
249 |
total = array[3] |
|
250 |
|
|
251 |
self.progressbar.goto((position * 100) // total) |
|
250 |
# def progress_callback(self, ev, eh, buf, array):
|
|
251 |
# position = array[2]
|
|
252 |
# total = array[3]
|
|
253 |
# |
|
254 |
# self.progressbar.goto((position * 100) // total)
|
|
252 | 255 |
|
253 | 256 |
def mount(self, readonly=False): |
254 | 257 |
"""Mount all disk partitions in a correct order.""" |
Also available in: Unified diff