Skip to content

Commit

Permalink
Merge branch 'testing'
Browse files Browse the repository at this point in the history
  • Loading branch information
acrn committed Feb 14, 2025
2 parents fe3bdcb + 98f7040 commit 96e2ae4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion files/scriptherder/scriptherder.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ def save_to_file(self, datadir: str, logger: logging.Logger, filename: Optional[
f.close()
os.rename(fn + ".tmp", fn + ".json")
self._data["filename"] = fn
os.umask(old_umask)

if self._output is not None:
assert self.output_filename is not None
Expand All @@ -395,6 +394,10 @@ def save_to_file(self, datadir: str, logger: logging.Logger, filename: Optional[
os.rename(output_fn + ".tmp", output_fn)
self._output = None

# Restore the umask after all
# file operations are done.
os.umask(old_umask)

def check(self, check: "Check", logger: logging.Logger) -> None:
"""
Figure out status of this job, based on it's check criteria.
Expand Down Expand Up @@ -1383,6 +1386,8 @@ def main(myname: str, args: Arguments, logger: Optional[logging.Logger] = None)
progname = os.path.basename(sys.argv[0])
args = parse_args(_defaults)
res = main(progname, args=args)
if isinstance(res, bool):
sys.exit(int(not res))
if isinstance(res, int):
sys.exit(res)
if res:
Expand Down

0 comments on commit 96e2ae4

Please sign in to comment.