agent: Fix python-2.4 compatibility

Rewrote the use of ternary operator to if since it is not
supported in python-2.4.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1006861
Change-Id: I03c63477a2d2bcb9eb4c4307946a3486300663e1
Signed-off-by: Martin Betak <mbetak@redhat.com>