Skip to content

Commit

Permalink
Merge pull request #13 from somasm-dev/master
Browse files Browse the repository at this point in the history
Fixing mode mismatch
  • Loading branch information
ydnath authored Nov 6, 2024
2 parents 50ccc85 + e644b6a commit 06e4c15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion jet/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,14 @@ def main():
else:
log.info("Checksum for file %s. %s %s:", destination, sha_bits, sha)

if f["mode"] is not None:
fmode = f["mode"]
else:
fmode = f"{os.stat(destination).st_mode&0o777:03o}"

content_manifest += "%s %s=%s uid=%s gid=%s mode=%s program_id=%s\n" % \
(f["destination"][1:] if f["destination"][0] == "/" else f["destination"],
sha_bits, sha, f["uid"], f["gid"], f["mode"], f["program_id"])
sha_bits, sha, f["uid"], f["gid"], fmode, f["program_id"])

if f["symlink"]:
contents_symlink += "%s%s %s\n" % (mount_dir, f["destination"], f["destination"])
Expand Down
2 changes: 1 addition & 1 deletion jet/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def required(d, k):
"destination": required(file, "destination"),
"uid": file.get("uid", 0),
"gid": file.get("gid", 0),
"mode": file.get("mode", 555),
"mode": file.get("mode", None),
"program_id": file.get("program_id", 1),
"symlink": file.get("symlink", True),
})
Expand Down

0 comments on commit 06e4c15

Please sign in to comment.