From c43a677e19ba1d2603dd4b7907fe053561c4fa06 Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Thu, 20 Apr 2017 04:34:16 -0700 Subject: [PATCH] Use dirname in object recursive import __file__ just returns the init file which there was nothing under. TrivialFix Change-Id: I39da8a50c0b9197b7a5cb3d5ca4fd95f8d739eaa --- neutron/objects/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/neutron/objects/__init__.py b/neutron/objects/__init__.py index a3079d0c1f2..be0ab4df740 100644 --- a/neutron/objects/__init__.py +++ b/neutron/objects/__init__.py @@ -10,10 +10,12 @@ # License for the specific language governing permissions and limitations # under the License. +import os import sys def register_objects(): # local import to avoid circular import failure from neutron.common import utils - utils.import_modules_recursively(sys.modules[__name__].__file__) + dirn = os.path.dirname(sys.modules[__name__].__file__) + utils.import_modules_recursively(dirn)