Skip to content

Commit

Permalink
Replaced opener with custom opener helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
fazledyn-or committed Dec 18, 2023
1 parent 2c766b4 commit 639f754
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pyanaconda/anaconda.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from pyanaconda.core import constants
from pyanaconda.core.startup.dbus_launcher import AnacondaDBusLauncher
from pyanaconda.core.kernel import kernel_arguments
from pyanaconda.core.path import open_with_perm
from pyanaconda.modules.common.constants.services import PAYLOADS
from pyanaconda.ui.lib.addons import collect_addon_ui_paths

Expand Down Expand Up @@ -191,11 +192,8 @@ def dumpState(self):
os.write(fd, dump_text_bytes)
os.close(fd)

def opener(path, flags):
return os.open(path, flags, 0o600)

# append to a given file
with open("/tmp/anaconda-tb-all.log", "a+", opener=opener) as f:
with open_with_perm("/tmp/anaconda-tb-all.log", "a+", 0o600) as f:
f.write("--- traceback: %s ---\n" % filename)
f.write(dump_text + "\n")

Expand Down

0 comments on commit 639f754

Please sign in to comment.