Make middleware.py Python 2.6 compatible
Make middleware.py Python 2.6 compatible

Fixes bug 1206256

In Python 2.6 xml.etree.ElementTree.fromstring raises
xml.parsers.expat.ExpatError instead of
xml.etree.ElementTree.ParseError when faced with invalid xml.
This change catches an import error and uses ExpatError instead of
ParseError.

Change-Id: I8ab41328c8eeacc28f4e01d730c73ff251df4a25

Juniper/ceilometer,tanglei528/ceilometer,citrix-openstack-build/ceilometer,rackerlabs/instrumented-ceilometer,citrix-openstack-build/ceilometer,r-mibu/ceilometer,openstack/ceilometer,rackerlabs/instrumented-ceilometer,MisterPup/Ceilometer-Juno-Extension,m1093782566/openstack_org_ceilometer,JioCloud/ceilometer,openstack/aodh,rackerlabs/instrumented-ceilometer,pczerkas/aodh,NeCTAR-RC/ceilometer,froyobin/ceilometer,mathslinux/ceilometer,mathslinux/ceilometer,cernops/ceilometer,NeCTAR-RC/ceilometer,JioCloud/ceilometer,openstack/aodh,redhat-openstack/ceilometer,Juniper/ceilometer,citrix-openstack-build/ceilometer,redhat-openstack/ceilometer,tanglei528/ceilometer,isyippee/ceilometer,sileht/aodh,maestro-hybrid-cloud/ceilometer,maestro-hybrid-cloud/ceilometer,chungg/aodh,JioCloud/ceilometer,MisterPup/Ceilometer-Juno-Extension,pkilambi/ceilometer,idegtiarov/ceilometer,rickerc/ceilometer_audit,eayunstack/ceilometer,chungg/aodh,idegtiarov/ceilometer,sileht/aodh,r-mibu/ceilometer,NeCTAR-RC/ceilometer,ityaptin/ceilometer,eayunstack/ceilometer,rickerc/ceilometer_audit,pkilambi/ceilometer,luogangyi/Ceilometer-oVirt,pczerkas/aodh,fabian4/ceilometer,tanglei528/ceilometer,isyippee/ceilometer,luogangyi/Ceilometer-oVirt,ityaptin/ceilometer,m1093782566/openstack_org_ceilometer,cernops/ceilometer,rickerc/ceilometer_audit,froyobin/ceilometer,fabian4/ceilometer,openstack/ceilometer