Skip to contentSkip to conversation

main - lvmdbusd: Remove try/except for mkfifo

PATCH Tony Asleson 1 participant 1 message Jun 30, 2022

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=01ef2f2525e8733f01443987b2c6f99882e04f3d
Commit:        01ef2f2525e8733f01443987b2c6f99882e04f3d
Parent:        0d957dcacc3118e9f2d4e83830d6c93b8955fd5f
Author:        Tony Asleson <[email protected]>
AuthorDate:    Tue Jun 7 08:21:03 2022 -0500
Committer:     Tony Asleson <[email protected]>
CommitterDate: Thu Jun 30 10:55:16 2022 -0500

lvmdbusd: Remove try/except for mkfifo

We should never run into this error condition when using tempfile.mkdtemp.

---
 daemons/lvmdbusd/lvm_shell_proxy.py.in | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
daemons/lvmdbusd/lvm_shell_proxy.py.in +2 -5
index fa2415fcf..5802d2d70 100644
@@ -122,11 +122,8 @@ class LVMShellProxy(object):
 		tmp_dir = tempfile.mkdtemp(prefix="lvmdbus_")
 		tmp_file = "%s/lvmdbus_report" % (tmp_dir)
 
-		try:
-			# Let's create a fifo for the report output
-			os.mkfifo(tmp_file, 0o600)
-		except FileExistsError:
-			pass
+		# Create a fifo for the report output
+		os.mkfifo(tmp_file, 0o600)
 
 		# Open the fifo for use to read and for lvm child process to write to.
 		self.report_fd = os.open(tmp_file, os.O_NONBLOCK)