From ccf69c73facd32f92a4404518feae135fe5828ff Mon Sep 17 00:00:00 2001 From: Ranald Lam Date: Tue, 8 Sep 2020 00:01:54 +0800 Subject: [PATCH] feat: Make no-conf apply to isolate config as well --- prerequisites.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/prerequisites.py b/prerequisites.py index 6981f421f6..b90d82936a 100755 --- a/prerequisites.py +++ b/prerequisites.py @@ -224,6 +224,19 @@ def install_isolate(): os.path.join(USR_ROOT, "bin", "isolate"), root, 0o4750, group=cmsuser_grp) +def install_isolate_conf(): + """This function installs the configuration files for isolate + + """ + assert_root() + root = pwd.getpwnam("root") + try: + cmsuser_grp = grp.getgrnam(CMSUSER) + except: + print("[Error] The user %s doesn't exist yet" % CMSUSER) + print("[Error] You need to run the install command at least once") + exit(1) + print("===== Copying isolate config to /usr/local/etc/") makedir(os.path.join(USR_ROOT, "etc"), root, 0o755) copyfile(os.path.join(".", "isolate", "default.cf"), @@ -313,6 +326,7 @@ def install(): old_umask = os.umask(0o000) if not NO_CONF: + install_isolate_conf() install_conf() print("===== Creating directories")