Close logging config file after write

Opening the logging config file with a context manager ensures that it
gets closed directly after writing. Without this a ResourceWarning
about an unclosed file is emitted on stderr[1].

[1]: Resource warning:

(...)/zuul/ansible/logconfig.py:164: ResourceWarning: unclosed file <_io.TextIOWrapper name='(...)/logging.json' mode='w' encoding='UTF-8'>
  open(filename, 'w').write(json.dumps(self._config, indent=2))

Change-Id: I5a8421d4480761d3e5557201b6c589892f034ecb
1 file changed