Re: [AUH] [PATCH v2 2/2] upgrade-helper: remove unused UpgradeNotNeededError

Alexander Kanavin <[email protected]>
Newsgroups org.yoctoproject.lists.yocto-patches
Message-ID <CANNYZj9nLc8tdUOmFXHHnpa77MVDPTzTmCoNzgfh87Bjw9OPhA@mail.gmail.com>
Thanks, applied and pushed.

Alex

On Wed, 3 Jun 2026 at 19:44, <[email protected]> wrote:
>
> From: Daniel Turull <[email protected]>
>
> UpgradeNotNeededError is never raised anywhere in the codebase.
> Remove the class definition and all references to it.
>
> Signed-off-by: Daniel Turull <[email protected]>
> ---
>  modules/errors.py     | 7 -------
>  modules/statistics.py | 4 +---
>  upgrade-helper.py     | 6 ++----
>  3 files changed, 3 insertions(+), 14 deletions(-)
>
> diff --git a/modules/errors.py b/modules/errors.py
> index 7adb103..9e8e6c9 100644
> --- a/modules/errors.py
> +++ b/modules/errors.py
> @@ -89,13 +89,6 @@ class UnsupportedProtocolError(Error):
>      def __str__(self):
>          return "Failed(Unsupported protocol)"
>
> -class UpgradeNotNeededError(Error):
> -    def __init__(self):
> -        super(UpgradeNotNeededError, self).__init__("Recipe already up to date")
> -
> -    def __str__(self):
> -        return "Failed(up to date)"
> -
>  class EmptyEnvError(Error):
>      def __init__(self, stdout):
>          super(EmptyEnvError, self).__init__("Empty environment returned", stdout)
> diff --git a/modules/statistics.py b/modules/statistics.py
> index 864cce8..227f0be 100644
> --- a/modules/statistics.py
> +++ b/modules/statistics.py
> @@ -34,9 +34,7 @@ class Statistics(object):
>          self.total_attempted = 0
>
>      def _update(self, pn, new_ver, maintainer, error):
> -        if type(error).__name__ == "UpgradeNotNeededError":
> -            return
> -        elif error is None:
> +        if error is None:
>              status = "Succeeded"
>          else:
>              status = str(error)
> diff --git a/upgrade-helper.py b/upgrade-helper.py
> index 46311f0..913bd87 100755
> --- a/upgrade-helper.py
> +++ b/upgrade-helper.py
> @@ -49,7 +49,7 @@ import shutil
>  sys.path.insert(1, os.path.join(os.path.abspath(
>      os.path.dirname(__file__)), 'modules'))
>
> -from errors import Error, EmptyEnvError, UpgradeNotNeededError, UnsupportedProtocolError
> +from errors import Error, EmptyEnvError, UnsupportedProtocolError
>
>  from utils.git import Git
>  from utils.devtool import Devtool
> @@ -527,9 +527,7 @@ class Updater(object):
>
>                  I(" %s: Upgrade SUCCESSFUL! Please test!" % pkggroup_name)
>              except Exception as e:
> -                if isinstance(e, UpgradeNotNeededError):
> -                    I(" %s: %s" % (pkggroup_name, e.message))
> -                elif isinstance(e, UnsupportedProtocolError):
> +                if isinstance(e, UnsupportedProtocolError):
>                      I(" %s: %s" % (pkggroup_name, e.message))
>                  else:
>                      if not isinstance(e, Error):
> --
> 2.51.0
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.