Fix error message in read_json
When using an unknown key in config_pull.py, e.g. Schedd
which was removed in 032f7949, the script is failing with:
> [17/35] RUN python2 /etc/condor/config_pull.py Schedd --remote https://gitlab.etp.kit.edu/EKPCondor/HTConfig.git:
#0 0.902 Traceback (most recent call last):
#0 0.902 File "/etc/condor/config_pull.py", line 271, in <module>
#0 0.902 GitConfigPull(**vars(parser.parse_args())).main()
#0 0.902 File "/etc/condor/config_pull.py", line 87, in main
#0 0.902 self._create_links()
#0 0.902 File "/etc/condor/config_pull.py", line 123, in _create_links
#0 0.902 config_files, script_files = self._read_json(json_file=self._json_filename, json_key=self._json_key)
#0 0.902 File "/etc/condor/config_pull.py", line 170, in _read_json
#0 0.902 if not os.path.exists(json_file):
#0 0.902 File "/usr/lib64/python2.7/genericpath.py", line 18, in exists
#0 0.902 os.stat(path)
#0 0.902 TypeError: coercing to Unicode: need string or buffer, file found
Using the .name
property of a file object returns the file path which makes the check work.