All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] test/py: fix printenv signon message disable code
@ 2016-06-16 18:59 Stephen Warren
  2016-06-17  4:38 ` Heiko Schocher
  2016-06-19 14:12 ` Tom Rini
  0 siblings, 2 replies; 4+ messages in thread
From: Stephen Warren @ 2016-06-16 18:59 UTC (permalink / raw)
  To: u-boot

From: Stephen Warren <swarren@nvidia.com>

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")
Cc: Heiko Schocher <hs@denx.de>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 test/py/tests/test_env.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/test/py/tests/test_env.py b/test/py/tests/test_env.py
index 22a22d1d538b..035dbf5cac4c 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:
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] test/py: fix printenv signon message disable code
  2016-06-16 18:59 [U-Boot] [PATCH] test/py: fix printenv signon message disable code Stephen Warren
@ 2016-06-17  4:38 ` Heiko Schocher
  2016-06-17 15:37   ` Stephen Warren
  2016-06-19 14:12 ` Tom Rini
  1 sibling, 1 reply; 4+ messages in thread
From: Heiko Schocher @ 2016-06-17  4:38 UTC (permalink / raw)
  To: u-boot

Hello Stephen,

Am 16.06.2016 um 20:59 schrieb Stephen Warren:
> From: Stephen Warren <swarren@nvidia.com>
>
> 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")
> Cc: Heiko Schocher <hs@denx.de>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
>   test/py/tests/test_env.py | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)

Thanks!
Acked-by: Heiko Schocher <hs@denx.de>

> diff --git a/test/py/tests/test_env.py b/test/py/tests/test_env.py
> index 22a22d1d538b..035dbf5cac4c 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:

Hmm... may we should also move VERSION_VARIABLE to Kconfig?

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] test/py: fix printenv signon message disable code
  2016-06-17  4:38 ` Heiko Schocher
@ 2016-06-17 15:37   ` Stephen Warren
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Warren @ 2016-06-17 15:37 UTC (permalink / raw)
  To: u-boot

On 06/16/2016 10:38 PM, Heiko Schocher wrote:
> Hello Stephen,
>
> Am 16.06.2016 um 20:59 schrieb Stephen Warren:
>> From: Stephen Warren <swarren@nvidia.com>
>>
>> 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")
>> Cc: Heiko Schocher <hs@denx.de>
>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>> ---
>>   test/py/tests/test_env.py | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> Thanks!
> Acked-by: Heiko Schocher <hs@denx.de>
>
>> diff --git a/test/py/tests/test_env.py b/test/py/tests/test_env.py
>> index 22a22d1d538b..035dbf5cac4c 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:
>
> Hmm... may we should also move VERSION_VARIABLE to Kconfig?

Be my guest:-) I believe the check above will automatically adapt to 
such a change, because the buildconfig object contains the union of all 
options found in .config (from Kconfig) and include/autoconf.mk (from 
include/configs/xxx.h).

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] test/py: fix printenv signon message disable code
  2016-06-16 18:59 [U-Boot] [PATCH] test/py: fix printenv signon message disable code Stephen Warren
  2016-06-17  4:38 ` Heiko Schocher
@ 2016-06-19 14:12 ` Tom Rini
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Rini @ 2016-06-19 14:12 UTC (permalink / raw)
  To: u-boot

On Thu, Jun 16, 2016 at 12:59:34PM -0600, Stephen Warren wrote:

> From: Stephen Warren <swarren@nvidia.com>
> 
> 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 <hs@denx.de>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160619/08878f01/attachment.sig>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-06-19 14:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-16 18:59 [U-Boot] [PATCH] test/py: fix printenv signon message disable code Stephen Warren
2016-06-17  4:38 ` Heiko Schocher
2016-06-17 15:37   ` Stephen Warren
2016-06-19 14:12 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.