Skip to content

Commit

Permalink
Do os.chmod and os.makedirs(mode...) to _really_ get permissions set.
Browse files Browse the repository at this point in the history
  • Loading branch information
schlafly authored and Planner committed Jul 28, 2023
1 parent 165688e commit f8d2d73
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions bin/fba_launch
Original file line number Diff line number Diff line change
Expand Up @@ -750,8 +750,9 @@ if __name__ == "__main__":
subdir = ('%06d' % args.tileid)[:3]
if not os.path.isdir(os.path.join(args.outdir, subdir)):
dirmode = 0o2775 if args.worldreadable else 0o2770
os.makedirs(os.path.join(args.outdir, subdir), exist_ok=True,
mode=dirmode)
fn = os.path.join(args.outdir, subdir)
os.makedirs(fn, exist_ok=True, mode=dirmode)
os.chmod(fn, mode=dirmode) # apparently umask can affect os.makedirs?

# AR utc_time_now, rundate, pmtime
utc_time_now = datetime.now(tz=timezone.utc)
Expand Down
4 changes: 2 additions & 2 deletions py/fiberassign/fba_launch_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -3613,8 +3613,8 @@ def copy_to_svn(svntiledir, tileid, myouts,
svntiledir = os.path.join(svntiledir, subdir)
files = []
files += [myouts['fiberassign'], myouts['log'], myouts['png']]
os.makedirs(svntiledir, exist_ok=True,
mode=dirmode)
os.makedirs(svntiledir, exist_ok=True, mode=dirmode)
os.chmod(svntiledir, mode=dirmode)
for filename in files:
# depending on specific steps that got executed, a file may not exist.
if not os.path.exists(filename):
Expand Down

0 comments on commit f8d2d73

Please sign in to comment.