Yeela Kaplan has uploaded a new change for review.
Change subject: utils: Add logs to rotateFiles ......................................................................
utils: Add logs to rotateFiles
Change-Id: If4636d54bb39db02301e2f528c9ca15f13472eaf Signed-off-by: Yeela Kaplan ykaplan@redhat.com --- M lib/vdsm/utils.py 1 file changed, 10 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/05/32605/1
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py index 3a83300..54fcfa0 100644 --- a/lib/vdsm/utils.py +++ b/lib/vdsm/utils.py @@ -156,6 +156,11 @@
def rotateFiles(directory, prefixName, gen, cp=False, persist=False): + ''' + gen: the max number of files rotated and saved under directory at a point + in time + cp : determines if rotate is done with root permissions + ''' logging.debug("dir: %s, prefixName: %s, versions: %s" % (directory, prefixName, gen)) gen = int(gen) @@ -188,7 +193,8 @@ unpersistFile(oldName) unpersistFile(newName) except: - pass + logging.warning("Failed to unpersist files: %s, %s", + oldName, newName) try: if cp: execCmd([constants.EXT_CP, oldName, newName], sudo=True) @@ -198,14 +204,13 @@ else: os.rename(oldName, newName) except: - pass + logging.warning("Failed to rotate file: %s to: %s", + oldName, newName) if persist and not cp: try: persistFile(newName) - execCmd([constants.EXT_PERSIST, newName], - sudo=True) except: - pass + logging.warning("Failed to persist file: %s" % newName)
def _parseMemInfo(lines):
oVirt Jenkins CI Server has posted comments on this change.
Change subject: utils: Add logs to rotateFiles ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11360/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12304/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12149/ : SUCCESS
oVirt Jenkins CI Server has posted comments on this change.
Change subject: utils: Add logs to rotateFiles ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11512/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12456/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12301/ : SUCCESS
oVirt Jenkins CI Server has posted comments on this change.
Change subject: utils: Add logs to rotateFiles ......................................................................
Patch Set 3:
Build Successful
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11600/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12544/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12389/ : SUCCESS
Nir Soffer has posted comments on this change.
Change subject: utils: Add logs to rotateFiles ......................................................................
Patch Set 3:
(1 comment)
http://gerrit.ovirt.org/#/c/32605/3/lib/vdsm/utils.py File lib/vdsm/utils.py:
Line 207: if persist and not cp: Line 208: try: Line 209: persistFile(newName) Line 210: except: Line 211: logging.warning("Failed to persist file: %s" % newName) It is more expensive to format logs when they are not used - use:
logging.warning("Failed to persist file: %s", newName) Line 212: Line 213: Line 214: def _parseMemInfo(lines): Line 215: """
Yeela Kaplan has abandoned this change.
Change subject: utils: Add logs to rotateFiles ......................................................................
Abandoned
vdsm-patches@lists.fedorahosted.org