diff options
author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2015-12-19 00:53:49 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-17 11:32:20 +0000 |
commit | 274d38a6e2183ec88335a08b963f26c34b328558 (patch) | |
tree | 7d8fdeea9f023920c3c9df66ecc022b6d0a3fad4 /meta/classes/toaster.bbclass | |
parent | 0e5402c433739a416a76df532378533cb25365c7 (diff) | |
download | openembedded-core-274d38a6e2183ec88335a08b963f26c34b328558.tar.gz openembedded-core-274d38a6e2183ec88335a08b963f26c34b328558.tar.bz2 openembedded-core-274d38a6e2183ec88335a08b963f26c34b328558.zip |
useradd-staticids.bbclass: Simplify some logic
The [<on_true>, <on_false>][not <condition>] construct may solve the
problem of implementing a conditional operator, but it is not very
readable. At least I find this:
uaargs.groupid = field[3] or uaargs.gid or uaargs.groupname
a lot more readable than this:
uaargs.groupid = [uaargs.gid, uaargs.groupname][not uaargs.gid]
uaargs.groupid = [field[3], uaargs.groupid][not field[3]]
Also, the official conditional operator since Python 2.5 (<on_true> if
<condition> else <on_false>) does not evaluate both <on_false> and
<on_true> as [<on_true>, <on_false>][not <condition>] does.
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/toaster.bbclass')
0 files changed, 0 insertions, 0 deletions