diff --git a/src/subscription_manager/cli_command/environments.py b/src/subscription_manager/cli_command/environments.py index ec645e46b..4d58e66fa 100644 --- a/src/subscription_manager/cli_command/environments.py +++ b/src/subscription_manager/cli_command/environments.py @@ -26,7 +26,6 @@ ERR_NOT_REGISTERED_MSG, ) from subscription_manager.cli_command.org import OrgCommand -from subscription_manager.cli_command.list import ENVIRONMENT_LIST from subscription_manager.i18n import ugettext as _ from subscription_manager.i18n import ungettext from subscription_manager.printing_utils import columnize, echo_columnize_callback @@ -36,8 +35,14 @@ log = logging.getLogger(__name__) + MULTI_ENV = "multi_environment" +ENVIRONMENT_LIST = [ + _("Name:"), + _("Description:"), +] + class EnvironmentsCommand(OrgCommand): def __init__(self): diff --git a/src/subscription_manager/cli_command/list.py b/src/subscription_manager/cli_command/list.py index 1b934259d..efc17ff7d 100644 --- a/src/subscription_manager/cli_command/list.py +++ b/src/subscription_manager/cli_command/list.py @@ -32,31 +32,6 @@ _("Arch:"), ] -AVAILABLE_SUBS_MATCH_COLUMNS = [ - _("Subscription Name:"), - _("Provides:"), - _("SKU:"), - _("Contract:"), - _("Service Level:"), -] - -REPOS_LIST = [ - _("Repo ID:"), - _("Repo Name:"), - _("Repo URL:"), - _("Enabled:"), -] - -ENVIRONMENT_LIST = [ - _("Name:"), - _("Description:"), -] - -ORG_LIST = [ - _("Name:"), - _("Key:"), -] - log = logging.getLogger(__name__) diff --git a/src/subscription_manager/cli_command/owners.py b/src/subscription_manager/cli_command/owners.py index 43a64210d..1b3c69b75 100644 --- a/src/subscription_manager/cli_command/owners.py +++ b/src/subscription_manager/cli_command/owners.py @@ -21,13 +21,17 @@ from subscription_manager.cli import system_exit from subscription_manager.cli_command.cli import handle_exception -from subscription_manager.cli_command.list import ORG_LIST from subscription_manager.cli_command.user_pass import UserPassCommand from subscription_manager.i18n import ugettext as _ from subscription_manager.printing_utils import columnize, echo_columnize_callback log = logging.getLogger(__name__) +ORG_LIST = [ + _("Name:"), + _("Key:"), +] + class OwnersCommand(UserPassCommand): def __init__(self): diff --git a/src/subscription_manager/cli_command/repos.py b/src/subscription_manager/cli_command/repos.py index fc87e5e0d..45cd46455 100644 --- a/src/subscription_manager/cli_command/repos.py +++ b/src/subscription_manager/cli_command/repos.py @@ -21,7 +21,6 @@ from subscription_manager.action_client import ProfileActionClient, ActionClient from subscription_manager.cli_command.cli import CliCommand -from subscription_manager.cli_command.list import REPOS_LIST from subscription_manager.i18n import ugettext as _ from subscription_manager.packageprofilelib import PackageProfileActionInvoker from subscription_manager.printing_utils import columnize, echo_columnize_callback @@ -31,6 +30,13 @@ log = logging.getLogger(__name__) +REPOS_LIST = [ + _("Repo ID:"), + _("Repo Name:"), + _("Repo URL:"), + _("Enabled:"), +] + class ReposAddRemoveAction(argparse.Action): """ diff --git a/test/test_printing_utils.py b/test/test_printing_utils.py index 69e02cff8..f9f45ac56 100644 --- a/test/test_printing_utils.py +++ b/test/test_printing_utils.py @@ -1,6 +1,5 @@ import unittest -from subscription_manager.cli_command.list import AVAILABLE_SUBS_MATCH_COLUMNS from subscription_manager.cli_command import status from subscription_manager.printing_utils import ( format_name, @@ -16,6 +15,15 @@ from unittest.mock import patch, Mock +FOO_COLUMNS = [ + "Subscription Name:", + "Provides:", + "SKU:", + "Contract:", + "Service Level:", +] + + class TestFormatName(unittest.TestCase): def setUp(self): self.indent = 1 @@ -66,7 +74,7 @@ def test_highlight_by_filter_string(self): args = ["Super Test Subscription"] kwargs = { "filter_string": "Super*", - "match_columns": AVAILABLE_SUBS_MATCH_COLUMNS, + "match_columns": FOO_COLUMNS, "caption": "Subscription Name:", "is_atty": True, } @@ -79,7 +87,7 @@ def test_highlight_by_filter_string_single(self): args = ["Super Test Subscription"] kwargs = { "filter_string": "*Subscriptio?", - "match_columns": AVAILABLE_SUBS_MATCH_COLUMNS, + "match_columns": FOO_COLUMNS, "caption": "Subscription Name:", "is_atty": True, } @@ -92,7 +100,7 @@ def test_highlight_by_filter_string_all(self): args = ["Super Test Subscription"] kwargs = { "filter_string": "*", - "match_columns": AVAILABLE_SUBS_MATCH_COLUMNS, + "match_columns": FOO_COLUMNS, "caption": "Subscription Name:", "is_atty": True, } @@ -103,7 +111,7 @@ def test_highlight_by_filter_string_exact(self): args = ["Premium"] kwargs = { "filter_string": "Premium", - "match_columns": AVAILABLE_SUBS_MATCH_COLUMNS, + "match_columns": FOO_COLUMNS, "caption": "Service Level:", "is_atty": True, } @@ -114,7 +122,7 @@ def test_highlight_by_filter_string_list_row(self): args = ["Awesome-os-stacked"] kwargs = { "filter_string": "Awesome*", - "match_columns": AVAILABLE_SUBS_MATCH_COLUMNS, + "match_columns": FOO_COLUMNS, "caption": "Subscription Name:", "is_atty": True, }