From d3963ff4947b7ef490ced35b51cb3b24a64b3030 Mon Sep 17 00:00:00 2001 From: Felix Moessbauer Date: Thu, 18 May 2023 09:15:07 +0200 Subject: [PATCH] refactor: remove dead code paths on task exception As the tasks with fail=True property return via an exception for a long time, the handling of the return code is not required anymore. This simplifies the code by removing dead code paths. Signed-off-by: Felix Moessbauer Signed-off-by: Jan Kiszka --- kas/repos.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/kas/repos.py b/kas/repos.py index 3000321..08e903a 100644 --- a/kas/repos.py +++ b/kas/repos.py @@ -226,8 +226,6 @@ class RepoImpl(Repo): (retc, _) = await run_cmd_async( self.clone_cmd(tmpdir, createref=True), cwd=get_context().kas_work_dir) - if retc != 0: - return retc logging.debug('Created repo ref for %s', self.qualified_name) try: @@ -244,8 +242,8 @@ class RepoImpl(Repo): (retc, _) = await run_cmd_async( self.clone_cmd(sdir, createref=False), cwd=get_context().kas_work_dir) - if retc == 0: - logging.info('Repository %s cloned', self.name) + + logging.info('Repository %s cloned', self.name) # Make sure the remote origin is set to the value # in the kas file to avoid surprises @@ -254,8 +252,6 @@ class RepoImpl(Repo): self.set_remote_url_cmd(), cwd=self.path, liveupdate=False) - if retc != 0: - return retc except NotImplementedError: logging.warning('Repo implementation does not support changing ' 'the remote url.') @@ -322,8 +318,6 @@ class RepoImpl(Repo): (retc, _) = await run_cmd_async(self.prepare_patches_cmd(), cwd=self.path) - if retc: - return retc my_patches = []