fix repo_id

This commit is contained in:
Andrew McLeod 2016-10-06 15:02:12 +02:00
parent 2096356687
commit abf0464187
1 changed files with 2 additions and 2 deletions

View File

@ -106,10 +106,10 @@ class REMOTEProxy():
for repo in self.repository.split(','): for repo in self.repository.split(','):
context = {'yum_repo': repo, 'yum_repo_id': repo_id} context = {'yum_repo': repo, 'yum_repo_id': repo_id}
_, filename = tempfile.mkstemp() _, filename = tempfile.mkstemp()
with open(filename + repo_id, 'w') as f: with open(filename, 'w') as f:
f.write(_render_template('yum.template', context)) f.write(_render_template('yum.template', context))
execute(copy_file_as_root, filename, execute(copy_file_as_root, filename,
'/etc/yum.repos.d/openstack-nova-compute-proxy.repo') '/etc/yum.repos.d/openstack-nova-compute-proxy-{}.repo'.format(repo_id))
os.unlink(filename) os.unlink(filename)
repo_id += 1 repo_id += 1