From 59a4c64670aea29a61600f3117a6a3d0fe8ffba4 Mon Sep 17 00:00:00 2001 From: Kaifeng Wang Date: Fri, 5 Jul 2019 13:29:45 +0800 Subject: [PATCH] Move dbsync to the correct path command line script should be placed in the cmd directory. Change-Id: Ifc3a9c81b0c61d8b5c9d9f4009164ec3c91ce042 --- ironic_inspector/{ => cmd}/dbsync.py | 4 ++-- ironic_inspector/test/functional.py | 2 +- ironic_inspector/test/unit/test_migrations.py | 2 +- setup.cfg | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename ironic_inspector/{ => cmd}/dbsync.py (95%) diff --git a/ironic_inspector/dbsync.py b/ironic_inspector/cmd/dbsync.py similarity index 95% rename from ironic_inspector/dbsync.py rename to ironic_inspector/cmd/dbsync.py index d2a1c7054..78cbd632c 100644 --- a/ironic_inspector/dbsync.py +++ b/ironic_inspector/cmd/dbsync.py @@ -60,8 +60,8 @@ command_opt = cfg.SubCommandOpt('command', def _get_alembic_config(): - return alembic_config.Config(os.path.join(os.path.dirname(__file__), - 'alembic.ini')) + base_path = os.path.split(os.path.dirname(__file__))[0] + return alembic_config.Config(os.path.join(base_path, 'alembic.ini')) def do_revision(config, cmd, *args, **kwargs): diff --git a/ironic_inspector/test/functional.py b/ironic_inspector/test/functional.py index f7edfc00b..bd8f49e0e 100644 --- a/ironic_inspector/test/functional.py +++ b/ironic_inspector/test/functional.py @@ -34,10 +34,10 @@ import six from six.moves import urllib from ironic_inspector.cmd import all as inspector_cmd +from ironic_inspector.cmd import dbsync from ironic_inspector.common import ironic as ir_utils from ironic_inspector.common import swift from ironic_inspector import db -from ironic_inspector import dbsync from ironic_inspector import introspection_state as istate from ironic_inspector import main from ironic_inspector import node_cache diff --git a/ironic_inspector/test/unit/test_migrations.py b/ironic_inspector/test/unit/test_migrations.py index b61c96b8a..401094454 100644 --- a/ironic_inspector/test/unit/test_migrations.py +++ b/ironic_inspector/test/unit/test_migrations.py @@ -39,8 +39,8 @@ from oslo_log import log as logging from oslo_utils import uuidutils import sqlalchemy +from ironic_inspector.cmd import dbsync from ironic_inspector import db -from ironic_inspector import dbsync from ironic_inspector import introspection_state as istate from ironic_inspector.test import base diff --git a/setup.cfg b/setup.cfg index c61ff0950..d7a4abf8e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -27,7 +27,7 @@ packages = [entry_points] console_scripts = ironic-inspector = ironic_inspector.cmd.all:main - ironic-inspector-dbsync = ironic_inspector.dbsync:main + ironic-inspector-dbsync = ironic_inspector.cmd.dbsync:main ironic-inspector-rootwrap = oslo_rootwrap.cmd:main ironic-inspector-migrate-data = ironic_inspector.cmd.migration:main ironic_inspector.hooks.processing =