Code cleaning of redirect.py

Change-Id: I764cfbcc55c0cc2b585cc55ccf3a5874572b17cd