Don't duplicate and shadow CGIT_URL

The openstack_election,utils module contains the path to the OpenStack
cgit.  Don't duplicate that in generate-rolls.  Also use the more
appropriate name for the URL to the owners module.

Change-Id: I268aaab07df25cdd36c55d224340cf816f32a463
This commit is contained in:
Tony Breeds 2017-08-02 16:43:40 +10:00
parent 21b862b005
commit 612319b404

View File

@ -27,8 +27,8 @@ from six.moves.urllib.request import urlopen
from openstack_election import utils
CGIT_URL = "http://git.openstack.org/cgit/openstack-infra/system-config/" \
"plain/tools/owners.py"
OWNERS_URL = ('%s/openstack-infra/system-config/plain/tools/owners.py' %
(utils.CGIT_URL))
# Exclude the system / bot accounts
# OpenStack Release Bot:
@ -73,9 +73,9 @@ def main():
os.chdir(os.path.dirname(args.rolls_dir))
if not args.cached_owners_script:
print("Grabbing script from: %s" % CGIT_URL)
print("Grabbing script from: %s" % OWNERS_URL)
with open("owners.py", "wb") as owner_file:
owner_file.write(urlopen(CGIT_URL).read())
owner_file.write(urlopen(OWNERS_URL).read())
sys.path.append(os.getcwd())
import owners