A minor refactor in wsgi.py
A minor refactor in wsgi.py

A minor refactor to move the code up in the file as suggested by termie
and henry regarding the review comments in
https://review.openstack.org/#/c/26487/

Fix bug 1166697

Change-Id: I890415c755dd383749f2d4382f53d0b3a6badc6c

openstack/keystone,townbull/keystone-dtrust,kwss/keystone,ilay09/keystone,himanshu-setia/keystone,ajayaa/keystone,ntt-sic/keystone,mahak/keystone,blueboxgroup/keystone,MaheshIBM/keystone,rushiagr/keystone,jamielennox/keystone,openstack/keystone,dsiddharth/access-keys,cernops/keystone,rushiagr/keystone,maestro-hybrid-cloud/keystone,rajalokan/keystone,takeshineshiro/keystone,rajalokan/keystone,derekchiang/keystone,klmitch/keystone,cloudbau/keystone,UTSA-ICS/keystone-kerberos,dsiddharth/access-keys,dstanek/keystone,himanshu-setia/keystone,ging/keystone,derekchiang/keystone,maestro-hybrid-cloud/keystone,dstanek/keystone,citrix-openstack-build/keystone,dstanek/keystone,rushiagr/keystone,mahak/keystone,roopali8/keystone,MaheshIBM/keystone,rodrigods/keystone,jamielennox/keystone,townbull/keystone-dtrust,dims/keystone,reeshupatel/demo,nuxeh/keystone,ilay09/keystone,cernops/keystone,vivekdhayaal/keystone,openstack/keystone,blueboxgroup/keystone,ajayaa/keystone,mahak/keystone,derekchiang/keystone,ntt-sic/keystone,JioCloud/keystone,kwss/keystone,roopali8/keystone,jumpstarter-io/keystone,dims/keystone,jonnary/keystone,jumpstarter-io/keystone,nuxeh/keystone,ntt-sic/keystone,cloudbau/keystone,kwss/keystone,citrix-openstack-build/keystone,nuxeh/keystone,klmitch/keystone,townbull/keystone-dtrust,rickerc/keystone_audit,cloudbau/keystone,reeshupatel/demo,idjaw/keystone,UTSA-ICS/keystone-kerberos,ilay09/keystone,JioCloud/keystone,reeshupatel/demo,ging/keystone,jumpstarter-io/keystone,rickerc/keystone_audit,promptworks/keystone,rodrigods/keystone,rajalokan/keystone,citrix-openstack-build/keystone,promptworks/keystone,vivekdhayaal/keystone,promptworks/keystone,vivekdhayaal/keystone,jonnary/keystone,takeshineshiro/keystone,idjaw/keystone,rickerc/keystone_audit,dsiddharth/access-keys