cli: Fix import paths to use cli/cros.
As part of the Brillo entry point, we're restructuring chromite/cros to
chromite/cli/cros instead. This CL just fixes module import paths to
point to the new location to make the restructuring functional.
See brbug.com/557 for more info.
BUG=brillo:557
TEST=cbuildbot/run_tests
Change-Id: I70c783f40e207090c5babf7ac149543613c8817e
Reviewed-on: https://chromium-review.googlesource.com/261183
Reviewed-by: David Pursell <dpursell@chromium.org>
Commit-Queue: David Pursell <dpursell@chromium.org>
Trybot-Ready: David Pursell <dpursell@chromium.org>
Tested-by: David Pursell <dpursell@chromium.org>
diff --git a/cli/command.py b/cli/command.py
index fc91218..c567b21 100644
--- a/cli/command.py
+++ b/cli/command.py
@@ -18,7 +18,6 @@
import glob
import os
-from chromite.cbuildbot import constants
from chromite.lib import brick_lib
from chromite.lib import cros_import
@@ -42,13 +41,13 @@
This method imports the cros_[!unittest] modules which may contain
commands. When these modules are loaded, declared commands (those that use
- the cros.CommandDecorator) will automatically get added to cros._commands.
+ the cros.CommandDecorator) will automatically get added to _commands.
"""
- subdir_path = os.path.join(constants.CHROMITE_DIR, 'cros', 'commands')
+ subdir_path = os.path.join(os.path.dirname(__file__), 'cros')
for file_path in _FindModules(subdir_path):
file_name = os.path.basename(file_path)
mod_name = os.path.splitext(file_name)[0]
- cros_import.ImportModule(('chromite', 'cros', 'commands', mod_name))
+ cros_import.ImportModule(('chromite', 'cli', 'cros', mod_name))
def ListCommands():