Skip to content

Commit

Permalink
prepare: Check if file exists before removing it
Browse files Browse the repository at this point in the history
  • Loading branch information
plfiorini committed Jan 8, 2017
1 parent 69d934e commit fee0969
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/prepare/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ def run():
boot_path = os.path.join(install_path, "boot", "vmlinuz-linux")
shutil.copyfile("/run/archiso/bootmnt/liri/boot/x86_64/vmlinuz", boot_path)

sudoers_livemedia_path = os.path.join(install_path, "etc", "sudoers.d", "00-livemedia")
sudoers_installer_path = os.path.join(install_path, "etc", "sudoers.d", "10-installer")
os.unlink(sudoers_livemedia_path)
os.unlink(sudoers_installer_path)
for sudoers_filename in ("00-livemedia", "10-installer"):
sudoers_path = os.path.join(install_path, "etc", "sudoers.d", sudoers_filename)
if os.path.exists(sudoers_path):
os.unlink(sudoers_path)

os_release = os.path.join(install_path, "usr", "lib", "os-release")
try:
Expand Down

0 comments on commit fee0969

Please # to comment.