mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
sharding: Move chown/chmod into where the files are written.
This commit is contained in:
committed by
Tim Abbott
parent
6249c2f970
commit
2bd4c07fdb
@@ -1,8 +1,10 @@
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import filecmp
|
||||
import grp
|
||||
import json
|
||||
import os
|
||||
import pwd
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
@@ -77,6 +79,14 @@ def write_updated_configs() -> None:
|
||||
data = {"shard_map": shard_map, "shard_regexes": shard_regexes}
|
||||
sharding_json_f.write(json.dumps(data) + "\n")
|
||||
|
||||
for fh in (nginx_sharding_conf_f, sharding_json_f):
|
||||
os.fchown(
|
||||
fh.fileno(),
|
||||
pwd.getpwnam("zulip").pw_uid,
|
||||
grp.getgrnam("zulip").gr_gid,
|
||||
)
|
||||
os.fchmod(fh.fileno(), 0o644)
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Adjust Tornado sharding configuration",
|
||||
|
||||
Reference in New Issue
Block a user