[virt-tools-list] [virt-manager] [PATCH v4 4/4] create: Show details of container bootstrap
Radostin Stoyanov
rstoyanov1 at gmail.com
Thu Jul 13 07:49:31 UTC 2017
Get get information about the progress from virt-bootstrap
and show it on GUI.
---
virtManager/create.py | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/virtManager/create.py b/virtManager/create.py
index 447e9de..65d9175 100644
--- a/virtManager/create.py
+++ b/virtManager/create.py
@@ -2601,7 +2601,8 @@ class vmmCreate(vmmGObjectUI):
def _create_directory_tree(self, asyncjob, meter, bootstrap_args):
"""
- Call bootstrap method from virtBootstrap.
+ Call bootstrap method from virtBootstrap and show logger messages
++ as state/details.
"""
import virtBootstrap
@@ -2610,6 +2611,13 @@ class vmmCreate(vmmGObjectUI):
meter.text = _(prog['status'])
meter.update(prog['value'])
+ asyncjob.details_enable()
+ # Use logging filter to show messages of the progreess on the GUI
+ class SetStateFilter(logging.Filter):
+ def filter(self, record):
+ asyncjob.details_update("%s\n" % record.getMessage())
+ return True
+
# Use string buffer to store log messages
log_stream = cStringIO.StringIO()
@@ -2619,6 +2627,8 @@ class vmmCreate(vmmGObjectUI):
# Create hander to store log messages in the string buffer
hdlr = logging.StreamHandler(log_stream)
hdlr.setFormatter(logging.Formatter('%(message)s'))
+ # Use logging filter to show messages on GUI
+ hdlr.addFilter(SetStateFilter())
vbLogger.addHandler(hdlr)
# Key word arguments to be passed
--
2.9.4
More information about the virt-tools-list
mailing list