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

fabiand at fedoraproject.org fabiand at fedoraproject.org
Fri Jun 28 12:07:13 UTC 2013


Fabian Deutsch has posted comments on this change.

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


Patch Set 1: I would prefer that you didn't submit this

(1 inline comment)

....................................................
File src/ovirt/node/utils/tuned.py
Line 49:     try:
Line 50:         profile = process.check_output("/usr/sbin/tuned-adm active")
Line 51:         return re.match(r'.*?: (.*)', profile).group(1)
Line 52:     except:
Line 53:         return "None"
I'd probably add a logger.debug call here just to catch the error - for the case of debugging ... or even make the except more strict by just ctaching the AttributeError - it can still be that tuned-adm does not exists which would throw a different error.

So I#d put a logger.debug call in the except block and de-indent return "None" by one.
Line 54: 
Line 55: 
Line 56: def set_active_profile(profile):
Line 57:     """Sets the active tuned profile on the system.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ieebaa1a6e304ab6c39edd788aaf7c9278e31e24a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: hadong <hadong0720 at gmail.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at fedoraproject.org>
Gerrit-Reviewer: Michael Burns <mburns at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the node-patches mailing list