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-18 11:47:06 +0000 |
commit | b18e40ce2f5859865d26a4010d78e65f6f2972fc (patch) | |
tree | 0e5182592cf4ca8bfbabb6e042ac3acf28d60e64 /meta/recipes-sato/libowl | |
parent | b689aa0df3c2cd36d3b54dd84ec3e264e8fd85ff (diff) | |
download | poky-b18e40ce2f5859865d26a4010d78e65f6f2972fc.tar.gz |
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.
(From OE-Core rev: 274d38a6e2183ec88335a08b963f26c34b328558)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-sato/libowl')
0 files changed, 0 insertions, 0 deletions