Skip to content

Commit

Permalink
Remove emitCheckFailed(), change it to logger.warn(). BZ 1048391
Browse files Browse the repository at this point in the history
Make acquireLock() respect debuglevel.
  • Loading branch information
megaumi authored and Zdenek Pavlas committed Jan 9, 2014
1 parent c267405 commit d044139
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions yum-cron/yum-cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,6 @@ def setupFailed(self, errmsg):
% errmsg)
self.sendMessages()

def lockFailed(self, errmsg):
"""Append a message to the output list stating that the
program failed to acquire the yum lock, then call sendMessages
to emit the output.
:param errmsg: a string that contains the error message
"""
self.output.append("Failed to acquire the yum lock with the following error message: \n%s"
% errmsg)
self.sendMessages()

def checkFailed(self, errmsg):
"""Append a message to the output stating that checking for
updates failed, then call sendMessages to emit the output.
Expand Down Expand Up @@ -196,16 +185,6 @@ def setupFailed(self, errmsg):
self.subject = "Yum: Failed to perform setup on %s" % self.opts.system_name
super(EmailEmitter, self).setupFailed(errmsg)

def lockFailed(self, errmsg):
"""Append a message to the output list stating that the
program failed to acquire the yum lock, then call sendMessages
to emit the output, and set an appropriate subject line.
:param errmsg: a string that contains the error message
"""
self.subject = "Yum: Failed to acquire the yum lock on %s" % self.opts.system_name
super(EmailEmitter, self).lockFailed(errmsg)

def checkFailed(self, errmsg):
"""Append a message to the output stating that checking for
updates failed, then call sendMessages to emit the output, and
Expand Down Expand Up @@ -406,7 +385,7 @@ def acquireLock(self):
try:
self.doLock()
except yum.Errors.LockError, e:
self.emitLockFailed("%s" % e)
self.logger.warn("Failed to acquire the yum lock: %s", e)
sys.exit(1)

def populateUpdateMetadata(self):
Expand Down Expand Up @@ -675,10 +654,6 @@ def emitSetupFailed(self, error):
"""Emit a notice stating that checking for updates failed."""
map(lambda x: x.setupFailed(error), self.emitters)

def emitLockFailed(self, errmsg):
"""Emit a notice that we failed to acquire the yum lock."""
map(lambda x: x.lockFailed(errmsg), self.emitters)

def emitCheckFailed(self, error):
"""Emit a notice stating that checking for updates failed."""
map(lambda x: x.checkFailed(error), self.emitters)
Expand Down

0 comments on commit d044139

Please sign in to comment.