Remove some inline if/else statements

Even though python syntax allows it, assignment of variables using
inline if...else... statements have the nasty problem of not showing
relevant information in the test coverage. Thus, by writing the
assignment in a more canonical and verbose form, we are sure that we are
actually covering the possible branches while testing.

Change-Id: I4fbce4422f4986a76255ad468ee7dd7475e3f1cf
Merge "Remove some inline if/else statements"