Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Allow update notifications to be send even when no updates are needed #121

Closed
kevin-j-smith opened this issue Apr 30, 2020 · 1 comment · May be fixed by #122
Closed

Enhancement: Allow update notifications to be send even when no updates are needed #121

kevin-j-smith opened this issue Apr 30, 2020 · 1 comment · May be fixed by #122

Comments

@kevin-j-smith
Copy link

For updatesCheck where:

        pups = self.refreshUpdates()
        gups = self.refreshGroupUpdates()

        # If neither have updates, we can just exit.
        if not (pups or gups):
            sys.exit(0)

Go ahead and emit message and release the lock even when no updates are available. Possible to give emitter flag to allow this to be configurable.

        pups = self.refreshUpdates()
        gups = self.refreshGroupUpdates()

        # If neither have updates, we can just exit.
        if not (pups or gups):
            self.emitMessages()
            self.releaseLocks()
            sys.exit(0)
class UpdateEmitter(object):
      def sendMessages(self):
        """Send the messages that have been stored.  This should be
        overridden by inheriting classes to emit the messages
        according to their individual methods.
        """

        if self.opts.emit_when_already_updated and not self.output:
          self.output.append("Yum Cron Update ran successfully and 0 packages needing updated")

        # Convert any byte strings to unicode objects now (so that we avoid
        # implicit conversions with the "ascii" codec later when join()-ing the
        # strings, leading to tracebacks).
        self.output = [x.decode('utf-8') if isinstance(x, str) else x
                       for x in self.output]

This will allow configurability and notification even when 0 packages need updating.

kevin-j-smith pushed a commit to kevin-j-smith/yum that referenced this issue Apr 30, 2020
@lukash
Copy link
Contributor

lukash commented Apr 30, 2020

As I've said in #120 : yum has been superseded by https://github.com/rpm-software-management/dnf, so any effort in this direction should be done over there. The development of yum has stopped.

@lukash lukash closed this as completed Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants