Skip to content

Commit

Permalink
feat: Load LDAP domain from config.json instead of command line argument
Browse files Browse the repository at this point in the history
  • Loading branch information
stephdl committed Nov 19, 2024
1 parent 26df31e commit 6b8a20c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions imageroot/bin/setup-ldap
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import sys
import agent
import subprocess
from agent.ldapproxy import Ldapproxy
import json

# Execute occ command
# It returns the process exit code and output
Expand All @@ -41,11 +42,10 @@ def occ(args):
def set_ldap(k, v):
return occ(["ldap:set-config", "s01", k, v])

if len(sys.argv) < 2:
print("setup-ldap: no argument given", file=sys.stderr)
sys.exit(1)
with open('config.json', 'r') as cf:
config = json.loads(cf.read())
cdomain = config.get("domain")

cdomain = sys.argv[1]
commands = []

if not cdomain:
Expand Down

0 comments on commit 6b8a20c

Please sign in to comment.