With commit
5980da5d we moved Cinder to using the olso.log
library. We also moved to the new oslo_log namespace. With that
change we should have also updated the hacking checks to include
looking for old uses of oslo.log.
This change adds the necessary hacking check.
Change-Id: I6a5d4b66d3258dbd01543be03810a8f84040e660
# NOTE(jsbryant): When other oslo libraries switch over non-namespaced
# imports, we will need to add them to the regex below.
oslo_namespace_imports = re.compile(r"from[\s]*oslo[.](concurrency|db"
- "|config|utils|serialization)")
+ "|config|utils|serialization|log)")
def no_vi_headers(physical_line, line_number, lines):
"from oslo.serialization import foo"))))
self.assertEqual(0, len(list(checks.check_oslo_namespace_imports(
"from oslo_serialization import bar"))))
+ self.assertEqual(1, len(list(checks.check_oslo_namespace_imports(
+ "from oslo.log import foo"))))
+ self.assertEqual(0, len(list(checks.check_oslo_namespace_imports(
+ "from oslo_log import bar"))))