From 9d848dd79eb43b62ad389675b1d8c8a79bd59b5b Mon Sep 17 00:00:00 2001 From: Eric Brown Date: Wed, 4 Apr 2018 16:03:56 -0700 Subject: [PATCH] Add bandit ID to prefix of more_info link In a recent commit [1], the names of the plugin doc files changed to include the bandit ID as a prefix. Unfortunately, the doc_utils wasn't updated at the time, so it still pointed to the previous docs, thus resulting in 404 errors when browsing to the link. This patch modifies doc_utils to properly prefix the bandit ID to reference the doc for a particular plugin. [1] https://review.openstack.org/#/c/540170/ Change-Id: Ia4b4c87e880ba39a677a84fc53943bc7a37849ef Closes-Bug: #1761254 --- bandit/core/docs_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bandit/core/docs_utils.py b/bandit/core/docs_utils.py index 2db26622..c5d72cdc 100644 --- a/bandit/core/docs_utils.py +++ b/bandit/core/docs_utils.py @@ -26,7 +26,8 @@ def get_url(bid): info = extension_loader.MANAGER.plugins_by_id.get(bid) if info is not None: - return BASE_URL + ('plugins/%s.html' % info.plugin.__name__) + return '%splugins/%s_%s.html' % (BASE_URL, bid.lower(), + info.plugin.__name__) info = extension_loader.MANAGER.blacklist_by_id.get(bid) if info is not None: