[node-devel] a problem about 3.0 ovirt-node's performance page

Bohai (ricky) bohai at huawei.com
Wed Jun 26 08:08:09 UTC 2013


Hi,

When I use the newest ovirt-node, the below exception occurred when I switch to the Performance page.
I read the code and try to fix it. It seems ok now.

diff --git a/src/ovirt/node/utils/tuned.py b/src/ovirt/node/utils/tuned.py
index 4be10fa..1d7a3b5 100644
--- a/src/ovirt/node/utils/tuned.py
+++ b/src/ovirt/node/utils/tuned.py
@@ -48,9 +48,9 @@ def get_active_profile():
     """
     try:
         profile = process.check_output("/usr/sbin/tuned-adm active")
+        return re.match(r'.*?: (.*)', profile).group(1)
     except:
         return "None"
-    return re.match(r'.*?: (.*)', profile).group(1)


 def set_active_profile(profile):


------------------------------detail debug log--------------------------------------------------------------------------
[root at localhost ~]# ovirt-node-setup --debug

Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/site-packages/ovirt/node/setup/__main__.py", line 31, in <module>
    app.run()
  File "/usr/lib/python2.7/site-packages/ovirt/node/app.py", line 303, in run
    self.ui.run()
  File "/usr/lib/python2.7/site-packages/ovirt/node/ui/urwid_builder.py", line 473, in run
    self.__loop.run()
  File "/usr/lib64/python2.7/site-packages/urwid/main_loop.py", line 271, in run
    self.screen.run_wrapper(self._run)
  File "/usr/lib64/python2.7/site-packages/urwid/raw_display.py", line 241, in run_wrapper
    return fn()
  File "/usr/lib64/python2.7/site-packages/urwid/main_loop.py", line 336, in _run
    self.event_loop.run()
  File "/usr/lib64/python2.7/site-packages/urwid/main_loop.py", line 707, in run
    self._loop()
  File "/usr/lib64/python2.7/site-packages/urwid/main_loop.py", line 786, in _loop
    self._watch_files[fd]()
  File "/usr/lib64/python2.7/site-packages/urwid/main_loop.py", line 387, in _update
    self.process_input(keys)
  File "/usr/lib64/python2.7/site-packages/urwid/main_loop.py", line 487, in process_input
    k = self._topmost_widget.keypress(self.screen_size, k)
  File "/usr/lib64/python2.7/site-packages/urwid/container.py", line 1102, in keypress
    return self.body.keypress( (maxcol, remaining), key )
  File "/usr/lib64/python2.7/site-packages/urwid/container.py", line 1559, in keypress
    key = self.focus.keypress(tsize, key)
  File "/usr/lib64/python2.7/site-packages/urwid/container.py", line 2240, in keypress
    key = w.keypress((mc,) + size[1:], key)
  File "/usr/lib64/python2.7/site-packages/urwid/container.py", line 1559, in keypress
    key = self.focus.keypress(tsize, key)
  File "/usr/lib64/python2.7/site-packages/urwid/container.py", line 2240, in keypress
    key = w.keypress((mc,) + size[1:], key)
  File "/usr/lib64/python2.7/site-packages/urwid/listbox.py", line 1000, in keypress
    return actual_key(self._keypress_down((maxcol, maxrow)))
  File "/usr/lib64/python2.7/site-packages/urwid/listbox.py", line 1108, in _keypress_down
    row_offset, 'above')
  File "/usr/lib64/python2.7/site-packages/urwid/listbox.py", line 842, in change_focus
    self.body.set_focus(position)
  File "/usr/lib64/python2.7/site-packages/urwid/listbox.py", line 179, in set_focus
    self._modified()
  File "/usr/lib64/python2.7/site-packages/urwid/listbox.py", line 159, in _modified
    ListWalker._modified(self)
  File "/usr/lib64/python2.7/site-packages/urwid/listbox.py", line 41, in _modified
    signals.emit_signal(self, "modified")
  File "/usr/lib64/python2.7/site-packages/urwid/signals.py", line 120, in emit
    result |= bool(callback(*args_copy))
  File "/usr/lib/python2.7/site-packages/ovirt/node/ui/widgets.py", line 334, in __on_item_change
    urwid.emit_signal(self, "changed", plugin)
  File "/usr/lib64/python2.7/site-packages/urwid/signals.py", line 120, in emit
    result |= bool(callback(*args_copy))
  File "/usr/lib/python2.7/site-packages/ovirt/node/ui/urwid_builder.py", line 524, in menu_item_changed
    self.application.switch_to_plugin(plugin)
  File "/usr/lib/python2.7/site-packages/ovirt/node/app.py", line 266, in switch_to_plugin
    self.show(content)
  File "/usr/lib/python2.7/site-packages/ovirt/node/app.py", line 276, in show
    self.populate_with_values(ui_container)
  File "/usr/lib/python2.7/site-packages/ovirt/node/app.py", line 247, in populate_with_values
    model = self.current_plugin().model()
  File "/usr/lib/python2.7/site-packages/ovirt/node/setup/core/performance_page.py", line 40, in model
    profile = tuned.get_active_profile()
  File "/usr/lib/python2.7/site-packages/ovirt/node/utils/tuned.py", line 53, in get_active_profile
    return re.match(r'.*?: (.*)', profile).group(1)
AttributeError: 'NoneType' object has no attribute 'group'

Best regards to you.
Ricky




More information about the node-devel mailing list