Use oslo.middleware instead of copy-pasted

Related-Bug:#1380725
Change-Id: I3f4ea433f4cf78080ba97f9fa6eec22bc1ef21a3
Merge "Use oslo.middleware instead of copy-pasted"