[elbe-devel] [PATCH 02/18] elbepack: esoap: remove non-functional FileNotFound handling
Thomas Weißschuh
thomas.weissschuh at linutronix.de
Tue Aug 13 13:15:32 CEST 2024
open() will never return a falsy value when a file is not found.
Instead a FileNotFoundError will be raised.
Remove the non-functional err handling from the soap daemon and its
callers.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
elbepack/commands/control.py | 3 ---
elbepack/daemons/soap/esoap.py | 2 --
elbepack/soapclient.py | 3 ---
3 files changed, 8 deletions(-)
diff --git a/elbepack/commands/control.py b/elbepack/commands/control.py
index 5df449b59bd4..528574587b1f 100644
--- a/elbepack/commands/control.py
+++ b/elbepack/commands/control.py
@@ -140,9 +140,6 @@ def _dump_file(client, args):
part = 0
while True:
ret = client.service.get_file(args.project_dir, args.file, part)
- if ret == 'FileNotFound':
- print(ret, file=sys.stderr)
- sys.exit(187)
if ret == 'EndOfFile':
return
diff --git a/elbepack/daemons/soap/esoap.py b/elbepack/daemons/soap/esoap.py
index e6e0d1766e5e..106dd0d4e514 100644
--- a/elbepack/daemons/soap/esoap.py
+++ b/elbepack/daemons/soap/esoap.py
@@ -125,8 +125,6 @@ class ESoap (ServiceBase):
return 'EndOfFile'
with open(file_name, 'rb') as fp:
- if not fp:
- return 'FileNotFound'
try:
fp.seek(pos)
data = fp.read(size)
diff --git a/elbepack/soapclient.py b/elbepack/soapclient.py
index 44df2e6d7102..6073a324f0ce 100644
--- a/elbepack/soapclient.py
+++ b/elbepack/soapclient.py
@@ -98,9 +98,6 @@ class ElbeSoapClient:
print('file transfer failed', file=sys.stderr)
sys.exit(170)
- if ret == 'FileNotFound':
- print(ret, file=sys.stderr)
- sys.exit(171)
if ret == 'EndOfFile':
fp.close()
return
--
2.46.0
More information about the elbe-devel
mailing list