Logo
Explore Get Started
openstack/manila
Code Issues Proposed changes
41192047aa
BranchesTags
View all branches
manila/tools/check_logging.sh

25 lines
429 B
Bash
Raw Normal View History

Remove unused logging import and LOG global This patch removes unused global LOG variable and logging imports from various manila modules, and adds a script to be run as part of pep8 that will ensure that these do not creep back into the codebase. Change-Id: I162c4b2478df45aaf6ea8009b102d6de1a4e309e
2016-04-04 07:01:28 -04:00
#!/bin/bash
tree=$1
tmpfile=$(mktemp)
find $tree -name '*.py' \
| xargs grep -l 'import log' \
| xargs grep -l '^LOG =' \
| xargs grep -c 'LOG' \
| grep ':1$' \
| awk -F ':' '{print $1}' > $tmpfile
count=$(wc -l < $tmpfile)
if [[ count -eq 0 ]]; then
rm $tmpfile
exit 0
fi
Fix URLs in code and documentation TrivialFix Change-Id: I21863f7fdad2bdd5dee226a3f6872d25b1c4f8ad Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2020-03-18 18:59:27 -07:00
echo 'Found files with unused LOG variable (see https://review.opendev.org/#/c/301054):'
Remove unused logging import and LOG global This patch removes unused global LOG variable and logging imports from various manila modules, and adds a script to be run as part of pep8 that will ensure that these do not creep back into the codebase. Change-Id: I162c4b2478df45aaf6ea8009b102d6de1a4e309e
2016-04-04 07:01:28 -04:00
cat $tmpfile
rm $tmpfile
exit 1
Copy Permalink
Powered by Gitea Version: v1.23.8 Page: 82ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API