global: flake8 and python2 fixes

Signed-off-by: Yoan Blanc <yoan.blanc@cern.ch>