From 4d6a60b40edc33c08a12f9acca72673632fac498 Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Tue, 13 Feb 2024 12:20:26 -0500 Subject: [PATCH] Fix import-outside-toplevel warnings Moved one import to the correct location, added a pylint disable directive for another since it is intended. No functional change. TrivialFix Change-Id: I5b78242c54564361492f58d30f4c546f46f53163 --- neutron/tests/functional/agent/linux/bin/ipt_binname.py | 1 + neutron/tests/functional/db/test_models.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/neutron/tests/functional/agent/linux/bin/ipt_binname.py b/neutron/tests/functional/agent/linux/bin/ipt_binname.py index e6f77ed20c2..943ad04802b 100755 --- a/neutron/tests/functional/agent/linux/bin/ipt_binname.py +++ b/neutron/tests/functional/agent/linux/bin/ipt_binname.py @@ -25,6 +25,7 @@ def print_binary_name(): # NOTE(yamamoto): Don't move this import to module-level. # The aim is to test importing from eventlet non-main thread. # See Bug #1367075 for details. + # pylint: disable=import-outside-toplevel from neutron.agent.linux import iptables_manager print(iptables_manager.binary_name) diff --git a/neutron/tests/functional/db/test_models.py b/neutron/tests/functional/db/test_models.py index 54149e99147..d82e40bd049 100644 --- a/neutron/tests/functional/db/test_models.py +++ b/neutron/tests/functional/db/test_models.py @@ -15,6 +15,7 @@ import sqlalchemy +from neutron.db.migration.models import head from neutron.tests.functional import base @@ -34,5 +35,4 @@ class TestDBCreation(base.BaseLoggingTestCase): metadata.create_all(self.engine) def test_head_creation(self): - from neutron.db.migration.models import head self._test_creation(head)