Backport https://review.openstack.org/#/c/61091/