From: Stephen Warren Date: Thu, 16 Jun 2016 18:59:34 +0000 (-0600) Subject: test/py: fix printenv signon message disable code X-Git-Tag: v2016.07-rc2~13 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7a8f8865582583314c884e77a607f5b9dc9cf8b6;p=u-boot test/py: fix printenv signon message disable code CONFIG_VERSION_VARIABLE isn't always defined, so we can't simply look up its value directly, or an exception will occur if it isn't defined. Instead, we must use .get() to supply a default value if the variable isn't defined. Fixes: da37f006e7c5 ("tests: py: disable main_signon check for printenv cmd") Acked-by: Heiko Schocher Signed-off-by: Stephen Warren --- diff --git a/test/py/tests/test_env.py b/test/py/tests/test_env.py index 22a22d1d53..035dbf5cac 100644 --- a/test/py/tests/test_env.py +++ b/test/py/tests/test_env.py @@ -39,7 +39,8 @@ class StateTestEnv(object): Nothing. """ - if self.u_boot_console.config.buildconfig['config_version_variable'] == 'y': + if self.u_boot_console.config.buildconfig.get( + 'config_version_variable', 'n') == 'y': with self.u_boot_console.disable_check('main_signon'): response = self.u_boot_console.run_command('printenv') else: