Merge "Remove openstack/common related stuff"
This commit is contained in:
commit
14b576def2
@ -2,7 +2,6 @@
|
|||||||
branch = True
|
branch = True
|
||||||
source = sahara
|
source = sahara
|
||||||
omit =
|
omit =
|
||||||
*/openstack/common/*
|
|
||||||
.tox/*
|
.tox/*
|
||||||
sahara/tests/*
|
sahara/tests/*
|
||||||
|
|
||||||
|
@ -157,5 +157,5 @@ fi
|
|||||||
if [ $coverage -eq 1 ]; then
|
if [ $coverage -eq 1 ]; then
|
||||||
echo "Generating coverage report in covhtml/"
|
echo "Generating coverage report in covhtml/"
|
||||||
${wrapper} coverage combine
|
${wrapper} coverage combine
|
||||||
${wrapper} coverage html --include='sahara/*' --omit='sahara/openstack/common/*' -d covhtml -i
|
${wrapper} coverage html --include='sahara/*' -d covhtml -i
|
||||||
fi
|
fi
|
||||||
|
@ -57,9 +57,6 @@ class HackingTestCase(testtools.TestCase):
|
|||||||
"from oslo_serialization import jsonutils as json", "path"))))
|
"from oslo_serialization import jsonutils as json", "path"))))
|
||||||
self.assertEqual(0, len(list(checks.use_jsonutils(
|
self.assertEqual(0, len(list(checks.use_jsonutils(
|
||||||
"import jsonschema", "path"))))
|
"import jsonschema", "path"))))
|
||||||
self.assertEqual(0, len(list(checks.use_jsonutils(
|
|
||||||
"import json", "sahara/openstack/common/utils.py"))))
|
|
||||||
|
|
||||||
self.assertEqual(1, len(list(checks.use_jsonutils(
|
self.assertEqual(1, len(list(checks.use_jsonutils(
|
||||||
"import json", "path"))))
|
"import json", "path"))))
|
||||||
self.assertEqual(1, len(list(checks.use_jsonutils(
|
self.assertEqual(1, len(list(checks.use_jsonutils(
|
||||||
|
@ -105,10 +105,6 @@ def use_jsonutils(logical_line, filename):
|
|||||||
"""
|
"""
|
||||||
if pep8.noqa(logical_line):
|
if pep8.noqa(logical_line):
|
||||||
return
|
return
|
||||||
ignore_dirs = ["sahara/openstack/common"]
|
|
||||||
for dir in ignore_dirs:
|
|
||||||
if dir in filename:
|
|
||||||
return
|
|
||||||
invalid_line = re.compile(r"(import\s+json)")
|
invalid_line = re.compile(r"(import\s+json)")
|
||||||
valid_line = re.compile(r"(import\s+jsonschema)")
|
valid_line = re.compile(r"(import\s+jsonschema)")
|
||||||
if (re.match(invalid_line, logical_line) and
|
if (re.match(invalid_line, logical_line) and
|
||||||
|
@ -42,13 +42,11 @@ def validate_log_translations(logical_line, filename):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
# NOTE(Kezar): sahara/tests included because we don't require translations
|
# NOTE(Kezar): sahara/tests included because we don't require translations
|
||||||
# in tests. sahara/openstack/common included because it's part imported
|
# in tests. sahara/db/templates provide separate cli interface so we don't
|
||||||
# from oslo and we don't change it forever and ever. sahara/db/templates
|
# want to translate it.
|
||||||
# provide separate cli interface so we don't want to translate it.
|
|
||||||
|
|
||||||
ignore_dirs = ["sahara/db/templates",
|
ignore_dirs = ["sahara/db/templates",
|
||||||
"sahara/tests",
|
"sahara/tests"]
|
||||||
"sahara/openstack/common"]
|
|
||||||
for directory in ignore_dirs:
|
for directory in ignore_dirs:
|
||||||
if directory in filename:
|
if directory in filename:
|
||||||
return
|
return
|
||||||
@ -98,13 +96,11 @@ def accepted_log_levels(logical_line, filename):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
# NOTE(Kezar): sahara/tests included because we don't require translations
|
# NOTE(Kezar): sahara/tests included because we don't require translations
|
||||||
# in tests. sahara/openstack/common included because it's part imported
|
# in tests. sahara/db/templates provide separate cli interface so we don't
|
||||||
# from oslo and we don't change it forever and ever. sahara/db/templates
|
# want to translate it.
|
||||||
# provide separate cli interface so we don't want to translate it.
|
|
||||||
|
|
||||||
ignore_dirs = ["sahara/db/templates",
|
ignore_dirs = ["sahara/db/templates",
|
||||||
"sahara/tests",
|
"sahara/tests"]
|
||||||
"sahara/openstack/common"]
|
|
||||||
for directory in ignore_dirs:
|
for directory in ignore_dirs:
|
||||||
if directory in filename:
|
if directory in filename:
|
||||||
return
|
return
|
||||||
|
@ -58,7 +58,7 @@ def run_in_subprocess(proc, func, args=None, kwargs=None, interactive=False):
|
|||||||
|
|
||||||
return result['output']
|
return result['output']
|
||||||
finally:
|
finally:
|
||||||
# NOTE(dmitryme): in openstack/common/processutils.py it
|
# NOTE(dmitryme): in oslo.concurrency's file processutils.py it
|
||||||
# is suggested to sleep a little between calls to multiprocessing.
|
# is suggested to sleep a little between calls to multiprocessing.
|
||||||
# That should allow it make some necessary cleanup
|
# That should allow it make some necessary cleanup
|
||||||
context.sleep(0)
|
context.sleep(0)
|
||||||
|
@ -32,9 +32,6 @@ ignore_codes = ["E1103"]
|
|||||||
# Note(maoy): the error message is the pattern of E0202. It should be ignored
|
# Note(maoy): the error message is the pattern of E0202. It should be ignored
|
||||||
# for sahara.tests modules
|
# for sahara.tests modules
|
||||||
ignore_messages = ["An attribute affected in sahara.tests"]
|
ignore_messages = ["An attribute affected in sahara.tests"]
|
||||||
# We ignore all errors in openstack.common because it should be checked
|
|
||||||
# elsewhere.
|
|
||||||
ignore_modules = ["sahara/openstack/common/"]
|
|
||||||
|
|
||||||
KNOWN_PYLINT_EXCEPTIONS_FILE = "tools/pylint_exceptions"
|
KNOWN_PYLINT_EXCEPTIONS_FILE = "tools/pylint_exceptions"
|
||||||
|
|
||||||
@ -88,8 +85,6 @@ class LintOutput(object):
|
|||||||
def is_ignored(self):
|
def is_ignored(self):
|
||||||
if self.code in ignore_codes:
|
if self.code in ignore_codes:
|
||||||
return True
|
return True
|
||||||
if any(self.filename.startswith(name) for name in ignore_modules):
|
|
||||||
return True
|
|
||||||
if any(msg in self.message for msg in ignore_messages):
|
if any(msg in self.message for msg in ignore_messages):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
2
tox.ini
2
tox.ini
@ -83,7 +83,7 @@ commands = bandit -c bandit.yaml -r sahara -n5 -p sahara_default -x tests
|
|||||||
[flake8]
|
[flake8]
|
||||||
show-source = true
|
show-source = true
|
||||||
builtins = _
|
builtins = _
|
||||||
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools
|
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools
|
||||||
|
|
||||||
[hacking]
|
[hacking]
|
||||||
import_exceptions = sahara.i18n._, sahara.i18n._LI, sahara.i18n._LW, sahara.i18n._LE, sahara.i18n._LC
|
import_exceptions = sahara.i18n._, sahara.i18n._LI, sahara.i18n._LW, sahara.i18n._LE, sahara.i18n._LC
|
||||||
|
Loading…
Reference in New Issue
Block a user