#531 people: when making the people page account for home directory we can't get into
Merged 3 years ago by pingou. Opened 3 years ago by pingou.
fedora-infra/ pingou/ansible fix_people_page  into  main

@@ -178,8 +178,14 @@ 

          continue

  

      user["name"] = pwentry.pw_gecos

-     user["has_public_html"] = (hdir / "public_html").is_dir()

-     user["has_public_git"] = (hdir / "public_git").is_dir()

+     try:

+         user["has_public_html"] = (hdir / "public_html").is_dir()

+     except PermissionError:

+         user["has_public_html"] = False

+     try:

+         user["has_public_git"] = (hdir / "public_git").is_dir()

+     except PermissionError:

+         user["has_public_git"] = False

      user["email_hash"] = hashlib.md5(

          f"{user['name'].lower()}@fedoraproject.org".encode("utf-8")

      ).hexdigest()
@@ -201,11 +207,16 @@ 

  with open(out_file, "w", encoding="utf-8") as handle:

      handle.write(page_output)

  

- # keep current owner uid

- st = out_file.stat()

- out_file_uid = st.st_uid

+ # The code below was present originally, however the cron job is ran under the

+ # `apache` user so it is not clear what this was meant to do.

+ # This is being kept here for convenience in case we need to re-activate this

+ # code, down the line this should just be removed.

  

+ # keep current owner uid

+ #st = out_file.stat()

+ #out_file_uid = st.st_uid

+ #

  # give write permissions to group

- out_file.chmod(st.st_mode | stat.S_IWGRP)

+ #out_file.chmod(st.st_mode | stat.S_IWGRP)

  # chown out file to group

- os.chown(out_file, out_file_uid, out_file_grp)

+ #os.chown(out_file, out_file_uid, out_file_grp)

Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr

+1 (note that people is not frozen, so please do push anytime... my mailbox will thank you)

note that people is not frozen, so please do push anytime... my mailbox will thank you

Yup, I checked this before debugging this live, but if you check the recent cron
error, you'll see the error changed :(

rebased onto 1da18b44a8d35297ab3776ee3b8c6f8be7f77654

3 years ago

rebased onto 692647e

3 years ago

rebased onto 692647e

3 years ago

Pull-Request has been merged by pingou

3 years ago
Metadata