[elbe-devel] [PATCH 3/4] updated: Don't catch ImportError for spyne

bage at linutronix.de bage at linutronix.de
Fri Oct 2 19:46:19 CEST 2020


From: Bastian Germann <bage at linutronix.de>

spyne is in the Debian package's Depends, so it must be available when
updated is install as Debian package.

Signed-off-by: Bastian Germann <bage at linutronix.de>
---
 elbepack/daemons/soap/__init__.py | 13 ++++---------
 elbepack/daemons/soap/esoap.py    | 15 +++++----------
 2 files changed, 9 insertions(+), 19 deletions(-)

diff --git a/elbepack/daemons/soap/__init__.py b/elbepack/daemons/soap/__init__.py
index ebe73f235..9bcabab82 100644
--- a/elbepack/daemons/soap/__init__.py
+++ b/elbepack/daemons/soap/__init__.py
@@ -11,19 +11,14 @@ import warnings
 from beaker.middleware import SessionMiddleware
 from cherrypy.process.plugins import SimplePlugin
 
+from spyne import Application
+from spyne.protocol.soap import Soap11
+from spyne.server.wsgi import WsgiApplication
+
 from elbepack.projectmanager import ProjectManager
 
 from .esoap import ESoap
 
-try:
-    from spyne import Application
-    from spyne.protocol.soap import Soap11
-    from spyne.server.wsgi import WsgiApplication
-except ImportError as e:
-    print("failed to import spyne", file=sys.stderr)
-    print("please install python(3)-spyne", file=sys.stderr)
-    sys.exit(20)
-
 
 logging.getLogger('spyne').setLevel(logging.INFO)
 
diff --git a/elbepack/daemons/soap/esoap.py b/elbepack/daemons/soap/esoap.py
index c64e6ba04..c4502c494 100644
--- a/elbepack/daemons/soap/esoap.py
+++ b/elbepack/daemons/soap/esoap.py
@@ -14,6 +14,11 @@ import sys
 
 from tempfile import NamedTemporaryFile
 
+from spyne.service import ServiceBase
+from spyne.decorator import rpc
+from spyne.model.primitive import String, Boolean, Integer
+from spyne.model.complex import Array
+
 from elbepack.shellhelper import system, command_out
 from elbepack.version import elbe_version, is_devel
 from elbepack.elbexml import ValidationMode
@@ -23,16 +28,6 @@ from .faults import soap_faults
 from .datatypes import SoapProject, SoapFile, SoapCmdReply
 from .authentication import authenticated_admin, authenticated_uid
 
-try:
-    from spyne.service import ServiceBase
-    from spyne.decorator import rpc
-    from spyne.model.primitive import String, Boolean, Integer
-    from spyne.model.complex import Array
-except ImportError as e:
-    print("failed to import spyne", file=sys.stderr)
-    print("please install python(3)-spyne", file=sys.stderr)
-    sys.exit(20)
-
 
 class ESoap (ServiceBase):
 
-- 
2.28.0



More information about the elbe-devel mailing list