Use cleaner version from cookiecutter OpenStack template

In one of the review comments [1], russellb said that the code in
cookiecutter OpenStack template is more cleaner. So incorporate that
logic here.

[1] https://review.openstack.org/#/c/55111

Change-Id: I1a298bc6a2429f591b062bbfa3b0ce7122268cc5
Merge "Use cleaner version from cookiecutter OpenStack template"