# HG changeset patch # User Goffi # Date 1562696446 -7200 # Node ID b300eaec53b6967855816032f668f6a4c05c3993 # Parent 1211dbc3cca71e087d6addc546bce70f750c7c0a server: don't raise error anymore if themes_dir is invalid or legacy blog can't be created: legacy blog will be entirely removed with 0.8 release, and themes_dir is only used by it. This patch limit troubles with this old code by not raising an error anymore if option is wrong or if the legacy blog can't be created. fix 317 diff -r 1211dbc3cca7 -r b300eaec53b6 libervia/server/server.py --- a/libervia/server/server.py Sat Jul 06 14:11:10 2019 +0200 +++ b/libervia/server/server.py Tue Jul 09 20:20:46 2019 +0200 @@ -2026,8 +2026,15 @@ self.putChildSAT("upload_avatar", _upload_avatar) # static pages - self.putChildSAT("blog_legacy", MicroBlog(self)) - self.putChildSAT(C.THEMES_URL, ProtectedFile(self.themes_dir)) + # FIXME: legacy blog must be removed entirely in 0.8 + try: + micro_blog = MicroBlog(self) + except Exception as e: + log.warning(u"Can't load legacy microblog, ignoring it: {reason}".format( + reason=e)) + else: + self.putChildSAT("blog_legacy", micro_blog) + self.putChildSAT(C.THEMES_URL, ProtectedFile(self.themes_dir)) # websocket if self.options["connection_type"] in ("https", "both"): diff -r 1211dbc3cca7 -r b300eaec53b6 twisted/plugins/libervia_server.py --- a/twisted/plugins/libervia_server.py Sat Jul 06 14:11:10 2019 +0200 +++ b/twisted/plugins/libervia_server.py Tue Jul 09 20:20:46 2019 +0200 @@ -103,9 +103,11 @@ ) themes_dir = os.path.join(value, C.THEMES_DIR) if not os.path.isfile(os.path.join(themes_dir, "default/styles/blog.css")): - raise ValueError( - "%s is not a Libervia's server data directory" % os.path.realpath(themes_dir) - ) + # XXX: we just display a message, as themes_dir is only used by legacy blog + # which will be removed entirely in 0.8 + # TODO: remove entirely legacy blog and linked options + print "%s is not a Libervia's server data directory" % os.path.realpath( + themes_dir) return value