[node-patches] Change in ovirt-node[master]: tuned.py: Catch the AttributeError when set the active tuned...

hadong0720 at gmail.com hadong0720 at gmail.com
Thu Jun 27 02:37:53 UTC 2013


hadong has uploaded a new change for review.

Change subject: tuned.py: Catch the AttributeError when set the active tuned profile as "None"
......................................................................

tuned.py: Catch the AttributeError when set the
active tuned profile as "None"

Previously when set the active tuned profile as "None", the performance
page will throw AttributeError exception.
Now catch this exception and return "None"

Change-Id: Ieebaa1a6e304ab6c39edd788aaf7c9278e31e24a
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=978646
Signed-off-by: hadong <hadong0720 at gmail.com>
---
M src/ovirt/node/utils/tuned.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/28/16128/1

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 @@
     """
     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):


-- 
To view, visit http://gerrit.ovirt.org/16128
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieebaa1a6e304ab6c39edd788aaf7c9278e31e24a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: hadong <hadong0720 at gmail.com>



More information about the node-patches mailing list