F821: undefined name
Currently, we define global variables at runtime in
keystoneclient/tests/test_shell.py, which cannot detected by hacking
rule check, then it fails for rule F821.
This patch changes the global lambda shell to a helper function.
Change-Id: Iaf5c4e40a6b17fbf4ba0c254b75d347f08b52364