Change in vdsm[master]: sampling: Collect kdump status

vfeenstr at redhat.com vfeenstr at redhat.com
Fri Mar 21 08:56:59 UTC 2014


Vinzenz Feenstra has posted comments on this change.

Change subject: sampling: Collect kdump status
......................................................................


Patch Set 3: Code-Review-1

(1 comment)

http://gerrit.ovirt.org/#/c/25926/3/vdsm/sampling.py
File vdsm/sampling.py:

Line 197:         except:
Line 198:             self.thpState = 'never'
Line 199:         try:
Line 200:             self.kdumpStatus = int(
Line 201:                 file(_KDUMP_STATUS_PATH).read().strip("\n")
- you're not closing the file handle.
  by using with, the file handle gets closed afterwards
- Also please use a more specific except handler.

Even though it was not like this before (as seen above) it's something we're trying to improve, and new code really should use this already.

try:
    with open(_KDUMP_STATUS_PATH, 'r') as f:
        self.kdumpStatus = int(f.read().strip('\n'))
except (IOError, OSError, ValueError):
    self.kdumpStatus = -1
Line 202:             )
Line 203:         except:
Line 204:             self.kdumpStatus = -1
Line 205: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I68d7a2a24fdaad74255004af0f327197eaee65f2
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Peřina <mperina at redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Martin Peřina <mperina at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list