On Wed, 21 Jan 2026 12:25:16 +0100
Mauro Carvalho Chehab <[email protected]> wrote:

> add a return code to subparser func() and return 1 if the
> command failed.
> 
> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Reviewed-by: Jonathan Cameron <[email protected]>

> ---
>  scripts/arm_processor_error.py | 2 +-
>  scripts/ghes_inject.py         | 3 ++-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/arm_processor_error.py b/scripts/arm_processor_error.py
> index 73d069f070d4..d9845adb0c0a 100644
> --- a/scripts/arm_processor_error.py
> +++ b/scripts/arm_processor_error.py
> @@ -473,4 +473,4 @@ def send_cper(self, args):
>  
>          self.data = data
>  
> -        qmp_cmd.send_cper(cper_guid.CPER_PROC_ARM, self.data)
> +        return qmp_cmd.send_cper(cper_guid.CPER_PROC_ARM, self.data)
> diff --git a/scripts/ghes_inject.py b/scripts/ghes_inject.py
> index 9a235201418b..6ac917d0b5db 100755
> --- a/scripts/ghes_inject.py
> +++ b/scripts/ghes_inject.py
> @@ -43,7 +43,8 @@ def main():
>  
>      args = parser.parse_args()
>      if "func" in args:
> -        args.func(args)
> +        if not args.func(args):
> +            sys.exit(1)
>      else:
>          sys.exit(f"Please specify a valid command for {sys.argv[0]}")
>  


Reply via email to