From 5eea962b27380ed5b9c466da73bce0486b2da7a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= Date: Thu, 14 Jan 2016 13:29:35 +0100 Subject: [PATCH] avocado.plugins.wrapper: Check the --gdb-run-bin value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --gdb-run-bin is incompatible with --wrapper option. The original code checked presence of "gdb_run_bin" in args, but it's always present with default value `[]`. This patch changes the check to gettattr. Signed-off-by: Lukáš Doktor --- avocado/plugins/wrapper.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/avocado/plugins/wrapper.py b/avocado/plugins/wrapper.py index 708c9a1f..eedcc93e 100644 --- a/avocado/plugins/wrapper.py +++ b/avocado/plugins/wrapper.py @@ -48,9 +48,10 @@ class Wrapper(CLI): 'only one global wrapper can be defined.') def run(self, args): - if 'wrapper' in args: + wraps = getattr(args, "wrapper", None) + if wraps: view = output.View(app_args=args) - if 'gdb_run_bin' in args and args.gdb_run_bin: + if getattr(args, 'gdb_run_bin', None): view.notify(event='error', msg='Command line option --wrapper is incompatible' ' with option --gdb-run-bin.') -- GitLab