Skip to content

Commit

Permalink
Merge pull request #15 from Selerity/i_13_14
Browse files Browse the repository at this point in the history
viya4-home-dir-builder Fixes for #13 and #14
  • Loading branch information
SelerityMichael authored Nov 14, 2022
2 parents 94e39df + 78e38c7 commit 074c4e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/viya4-home-dir-builder/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ maintainers:

type: application

version: 0.2.2
version: 0.2.3

appVersion: latest
7 changes: 5 additions & 2 deletions charts/viya4-home-dir-builder/home_dir_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ def get_uids(viya_base_url, access_token):
for user in users:
url = f"{viya_base_url}/identities/users/{user['id']}/identifier"
response = requests.request("GET", url, headers=headers)
uid[user['id']] = response.json()["uid"]
try:
uid[user['id']] = response.json()["uid"]
except:
log.error(f"Unable to get details for for {user['id']}")
return(uid)

def home_dir_builder(consul_token, viya_base_url, client_id, client_secret, home_dir_path, user_exceptions, dry_run):
Expand Down Expand Up @@ -142,7 +145,7 @@ def home_dir_builder(consul_token, viya_base_url, client_id, client_secret, home
if dry_run == '0':
try:
new_home_dir = Path(home, uid)
new_home_dir.mkdir(mode=750)
new_home_dir.mkdir(mode=0a750)
log.info(f"Created home directory for {uid}")
try:
os.chown(new_home_dir, uids[uid], 1001)
Expand Down

0 comments on commit 074c4e1

Please sign in to comment.