File 0001-Catch-any-exception-when-trying-to-call-git.patch of Package python-openstackdocstheme
From 605f89e5e0f760cb0312fe9bc57db17bc041a753 Mon Sep 17 00:00:00 2001
From: Thomas Bechtold <tbechtold@suse.com>
Date: Thu, 22 Aug 2019 06:55:15 +0200
Subject: [PATCH] Catch any exception when trying to call "git"
Some projects (like Neutron) do import eventlet in docs/source/conf.py
. eventlet patches the subprocess module and due to that, the
submodule.CalledProcessError exception is not catched. So building the
documentation from an sdist tarball with having git installed (this
combination is common in package build envs like RDO) fails with:
subprocess.CalledProcessError: Command '['git', 'log', '-n1', \
'--format=%ad', [...snipped...]
Change-Id: Ibff93605996855f01ba2bbe793285674b5c71d2e
---
openstackdocstheme/page_context.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/openstackdocstheme/page_context.py b/openstackdocstheme/page_context.py
index 945bbff..7509296 100644
--- a/openstackdocstheme/page_context.py
+++ b/openstackdocstheme/page_context.py
@@ -35,7 +35,11 @@ def _get_last_updated_file(src_file):
'--', src_file,
]
).decode('utf-8').strip()
- except (subprocess.CalledProcessError, OSError) as err:
+ # NOTE: we catch any exception here (instead of
+ # subprocess.CalledProcessError and OSError) because some projects (eg.
+ # neutron) do import eventlet in docs/source/conf.py which will patch
+ # the subprocess module and with that, the exception is not catched
+ except Exception as err:
LOG.info(
'[openstackdocstheme] Could not get modification time of %s: %s',
src_file, err)
--
2.22.0