Skip to content
Snippets Groups Projects

Fix error message in read_json

Merged Cedric Verstege requested to merge config_fix into master

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.

Merge request reports

Approval is optional

Merged by Lea ReuterLea Reuter 1 year ago (Sep 11, 2023 11:24am UTC)

Merge details

  • Changes merged into master with a2c10973.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading