Flatten the project structure
In this changeset, I flattened the project structure by removing the 'osc' package as it is now shared by both the OSC plugin and by the 'watcher' command. Closes-Bug: #1570467 Partially Implements: blueprint openstackclient-plugin Change-Id: I867fd23c3a27cfc925dcc28f8dd158cb690c5659
This commit is contained in:
88
setup.cfg
88
setup.cfg
@@ -24,69 +24,69 @@ packages =
|
|||||||
|
|
||||||
[entry_points]
|
[entry_points]
|
||||||
console_scripts =
|
console_scripts =
|
||||||
watcher = watcherclient.watcher:main
|
watcher = watcherclient.shell:main
|
||||||
|
|
||||||
openstack.cli.extension =
|
openstack.cli.extension =
|
||||||
infra_optim = watcherclient.plugin
|
infra_optim = watcherclient.plugin
|
||||||
|
|
||||||
# Entry points for the 'openstack' command
|
# Entry points for the 'openstack' command
|
||||||
openstack.infra_optim.v1 =
|
openstack.infra_optim.v1 =
|
||||||
optimize_goal_show = watcherclient.v1.osc.goal_shell:ShowGoal
|
optimize_goal_show = watcherclient.v1.goal_shell:ShowGoal
|
||||||
optimize_goal_list = watcherclient.v1.osc.goal_shell:ListGoal
|
optimize_goal_list = watcherclient.v1.goal_shell:ListGoal
|
||||||
|
|
||||||
optimize_strategy_show = watcherclient.v1.osc.strategy_shell:ShowStrategy
|
optimize_strategy_show = watcherclient.v1.strategy_shell:ShowStrategy
|
||||||
optimize_strategy_list = watcherclient.v1.osc.strategy_shell:ListStrategy
|
optimize_strategy_list = watcherclient.v1.strategy_shell:ListStrategy
|
||||||
|
|
||||||
optimize_audittemplate_show = watcherclient.v1.osc.audit_template_shell:ShowAuditTemplate
|
optimize_audittemplate_show = watcherclient.v1.audit_template_shell:ShowAuditTemplate
|
||||||
optimize_audittemplate_list = watcherclient.v1.osc.audit_template_shell:ListAuditTemplate
|
optimize_audittemplate_list = watcherclient.v1.audit_template_shell:ListAuditTemplate
|
||||||
optimize_audittemplate_create = watcherclient.v1.osc.audit_template_shell:CreateAuditTemplate
|
optimize_audittemplate_create = watcherclient.v1.audit_template_shell:CreateAuditTemplate
|
||||||
optimize_audittemplate_update = watcherclient.v1.osc.audit_template_shell:UpdateAuditTemplate
|
optimize_audittemplate_update = watcherclient.v1.audit_template_shell:UpdateAuditTemplate
|
||||||
optimize_audittemplate_delete = watcherclient.v1.osc.audit_template_shell:DeleteAuditTemplate
|
optimize_audittemplate_delete = watcherclient.v1.audit_template_shell:DeleteAuditTemplate
|
||||||
|
|
||||||
optimize_audit_show = watcherclient.v1.osc.audit_shell:ShowAudit
|
optimize_audit_show = watcherclient.v1.audit_shell:ShowAudit
|
||||||
optimize_audit_list = watcherclient.v1.osc.audit_shell:ListAudit
|
optimize_audit_list = watcherclient.v1.audit_shell:ListAudit
|
||||||
optimize_audit_create = watcherclient.v1.osc.audit_shell:CreateAudit
|
optimize_audit_create = watcherclient.v1.audit_shell:CreateAudit
|
||||||
optimize_audit_update = watcherclient.v1.osc.audit_shell:UpdateAudit
|
optimize_audit_update = watcherclient.v1.audit_shell:UpdateAudit
|
||||||
optimize_audit_delete = watcherclient.v1.osc.audit_shell:DeleteAudit
|
optimize_audit_delete = watcherclient.v1.audit_shell:DeleteAudit
|
||||||
|
|
||||||
optimize_actionplan_show = watcherclient.v1.osc.action_plan_shell:ShowActionPlan
|
optimize_actionplan_show = watcherclient.v1.action_plan_shell:ShowActionPlan
|
||||||
optimize_actionplan_list = watcherclient.v1.osc.action_plan_shell:ListActionPlan
|
optimize_actionplan_list = watcherclient.v1.action_plan_shell:ListActionPlan
|
||||||
optimize_actionplan_create = watcherclient.v1.osc.action_plan_shell:CreateActionPlan
|
optimize_actionplan_create = watcherclient.v1.action_plan_shell:CreateActionPlan
|
||||||
optimize_actionplan_update = watcherclient.v1.osc.action_plan_shell:UpdateActionPlan
|
optimize_actionplan_update = watcherclient.v1.action_plan_shell:UpdateActionPlan
|
||||||
optimize_actionplan_start = watcherclient.v1.osc.action_plan_shell:StartActionPlan
|
optimize_actionplan_start = watcherclient.v1.action_plan_shell:StartActionPlan
|
||||||
|
|
||||||
optimize_action_show = watcherclient.v1.osc.action_shell:ShowAction
|
optimize_action_show = watcherclient.v1.action_shell:ShowAction
|
||||||
optimize_action_list = watcherclient.v1.osc.action_shell:ListAction
|
optimize_action_list = watcherclient.v1.action_shell:ListAction
|
||||||
|
|
||||||
# The same as above but used by the 'watcher' command
|
# The same as above but used by the 'watcher' command
|
||||||
watcherclient.v1 =
|
watcherclient.v1 =
|
||||||
goal_show = watcherclient.v1.osc.goal_shell:ShowGoal
|
goal_show = watcherclient.v1.goal_shell:ShowGoal
|
||||||
goal_list = watcherclient.v1.osc.goal_shell:ListGoal
|
goal_list = watcherclient.v1.goal_shell:ListGoal
|
||||||
|
|
||||||
strategy_show = watcherclient.v1.osc.strategy_shell:ShowStrategy
|
strategy_show = watcherclient.v1.strategy_shell:ShowStrategy
|
||||||
strategy_list = watcherclient.v1.osc.strategy_shell:ListStrategy
|
strategy_list = watcherclient.v1.strategy_shell:ListStrategy
|
||||||
|
|
||||||
audittemplate_show = watcherclient.v1.osc.audit_template_shell:ShowAuditTemplate
|
audittemplate_show = watcherclient.v1.audit_template_shell:ShowAuditTemplate
|
||||||
audittemplate_list = watcherclient.v1.osc.audit_template_shell:ListAuditTemplate
|
audittemplate_list = watcherclient.v1.audit_template_shell:ListAuditTemplate
|
||||||
audittemplate_create = watcherclient.v1.osc.audit_template_shell:CreateAuditTemplate
|
audittemplate_create = watcherclient.v1.audit_template_shell:CreateAuditTemplate
|
||||||
audittemplate_update = watcherclient.v1.osc.audit_template_shell:UpdateAuditTemplate
|
audittemplate_update = watcherclient.v1.audit_template_shell:UpdateAuditTemplate
|
||||||
audittemplate_delete = watcherclient.v1.osc.audit_template_shell:DeleteAuditTemplate
|
audittemplate_delete = watcherclient.v1.audit_template_shell:DeleteAuditTemplate
|
||||||
|
|
||||||
audit_show = watcherclient.v1.osc.audit_shell:ShowAudit
|
audit_show = watcherclient.v1.audit_shell:ShowAudit
|
||||||
audit_list = watcherclient.v1.osc.audit_shell:ListAudit
|
audit_list = watcherclient.v1.audit_shell:ListAudit
|
||||||
audit_create = watcherclient.v1.osc.audit_shell:CreateAudit
|
audit_create = watcherclient.v1.audit_shell:CreateAudit
|
||||||
audit_update = watcherclient.v1.osc.audit_shell:UpdateAudit
|
audit_update = watcherclient.v1.audit_shell:UpdateAudit
|
||||||
audit_delete = watcherclient.v1.osc.audit_shell:DeleteAudit
|
audit_delete = watcherclient.v1.audit_shell:DeleteAudit
|
||||||
|
|
||||||
actionplan_show = watcherclient.v1.osc.action_plan_shell:ShowActionPlan
|
actionplan_show = watcherclient.v1.action_plan_shell:ShowActionPlan
|
||||||
actionplan_list = watcherclient.v1.osc.action_plan_shell:ListActionPlan
|
actionplan_list = watcherclient.v1.action_plan_shell:ListActionPlan
|
||||||
actionplan_create = watcherclient.v1.osc.action_plan_shell:CreateActionPlan
|
actionplan_create = watcherclient.v1.action_plan_shell:CreateActionPlan
|
||||||
actionplan_update = watcherclient.v1.osc.action_plan_shell:UpdateActionPlan
|
actionplan_update = watcherclient.v1.action_plan_shell:UpdateActionPlan
|
||||||
actionplan_start = watcherclient.v1.osc.action_plan_shell:StartActionPlan
|
actionplan_start = watcherclient.v1.action_plan_shell:StartActionPlan
|
||||||
actionplan_delete = watcherclient.v1.osc.action_plan_shell:DeleteActionPlan
|
actionplan_delete = watcherclient.v1.action_plan_shell:DeleteActionPlan
|
||||||
|
|
||||||
action_show = watcherclient.v1.osc.action_shell:ShowAction
|
action_show = watcherclient.v1.action_shell:ShowAction
|
||||||
action_list = watcherclient.v1.osc.action_shell:ListAction
|
action_list = watcherclient.v1.action_shell:ListAction
|
||||||
|
|
||||||
[pbr]
|
[pbr]
|
||||||
autodoc_index_modules = True
|
autodoc_index_modules = True
|
||||||
|
@@ -19,9 +19,9 @@ import shlex
|
|||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
|
from watcherclient import shell
|
||||||
from watcherclient.tests import utils
|
from watcherclient.tests import utils
|
||||||
from watcherclient.v1 import client
|
from watcherclient.v1 import client
|
||||||
from watcherclient import watcher
|
|
||||||
|
|
||||||
|
|
||||||
class CommandTestCase(utils.BaseTestCase):
|
class CommandTestCase(utils.BaseTestCase):
|
||||||
@@ -35,7 +35,7 @@ class CommandTestCase(utils.BaseTestCase):
|
|||||||
|
|
||||||
self.m_watcher_client = mock.Mock(side_effect=client.Client)
|
self.m_watcher_client = mock.Mock(side_effect=client.Client)
|
||||||
self.p_create_client = mock.patch.object(
|
self.p_create_client = mock.patch.object(
|
||||||
watcher.WatcherShell, 'create_client', self.m_watcher_client)
|
shell.WatcherShell, 'create_client', self.m_watcher_client)
|
||||||
self.p_create_client.start()
|
self.p_create_client.start()
|
||||||
|
|
||||||
self.addCleanup(self.p_build_http_client.stop)
|
self.addCleanup(self.p_build_http_client.stop)
|
@@ -20,10 +20,10 @@ import mock
|
|||||||
import six
|
import six
|
||||||
|
|
||||||
from watcherclient import exceptions
|
from watcherclient import exceptions
|
||||||
from watcherclient.tests.v1.osc import base
|
from watcherclient import shell
|
||||||
|
from watcherclient.tests.v1 import base
|
||||||
from watcherclient import v1 as resource
|
from watcherclient import v1 as resource
|
||||||
from watcherclient.v1 import resource_fields
|
from watcherclient.v1 import resource_fields
|
||||||
from watcherclient import watcher as shell
|
|
||||||
|
|
||||||
ACTION_PLAN_1 = {
|
ACTION_PLAN_1 = {
|
||||||
'uuid': 'd9d9978e-6db5-4a05-8eab-1531795d7004',
|
'uuid': 'd9d9978e-6db5-4a05-8eab-1531795d7004',
|
@@ -20,10 +20,10 @@ import mock
|
|||||||
import six
|
import six
|
||||||
|
|
||||||
from watcherclient import exceptions
|
from watcherclient import exceptions
|
||||||
from watcherclient.tests.v1.osc import base
|
from watcherclient import shell
|
||||||
|
from watcherclient.tests.v1 import base
|
||||||
from watcherclient import v1 as resource
|
from watcherclient import v1 as resource
|
||||||
from watcherclient.v1 import resource_fields
|
from watcherclient.v1 import resource_fields
|
||||||
from watcherclient import watcher as shell
|
|
||||||
|
|
||||||
ACTION_1 = {
|
ACTION_1 = {
|
||||||
'uuid': '770ef053-ecb3-48b0-85b5-d55a2dbc6588',
|
'uuid': '770ef053-ecb3-48b0-85b5-d55a2dbc6588',
|
@@ -20,10 +20,10 @@ import mock
|
|||||||
import six
|
import six
|
||||||
|
|
||||||
from watcherclient import exceptions
|
from watcherclient import exceptions
|
||||||
from watcherclient.tests.v1.osc import base
|
from watcherclient import shell
|
||||||
|
from watcherclient.tests.v1 import base
|
||||||
from watcherclient import v1 as resource
|
from watcherclient import v1 as resource
|
||||||
from watcherclient.v1 import resource_fields
|
from watcherclient.v1 import resource_fields
|
||||||
from watcherclient import watcher as shell
|
|
||||||
|
|
||||||
AUDIT_TEMPLATE_1 = {
|
AUDIT_TEMPLATE_1 = {
|
||||||
'uuid': 'f8e47706-efcf-49a4-a5c4-af604eb492f2',
|
'uuid': 'f8e47706-efcf-49a4-a5c4-af604eb492f2',
|
@@ -19,11 +19,10 @@ import datetime
|
|||||||
import mock
|
import mock
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from watcherclient.tests.v1.osc import base
|
from watcherclient import shell
|
||||||
|
from watcherclient.tests.v1 import base
|
||||||
from watcherclient import v1 as resource
|
from watcherclient import v1 as resource
|
||||||
from watcherclient.v1 import resource_fields
|
from watcherclient.v1 import resource_fields
|
||||||
from watcherclient import watcher as shell
|
|
||||||
|
|
||||||
|
|
||||||
AUDIT_TEMPLATE_1 = {
|
AUDIT_TEMPLATE_1 = {
|
||||||
'uuid': 'f8e47706-efcf-49a4-a5c4-af604eb492f2',
|
'uuid': 'f8e47706-efcf-49a4-a5c4-af604eb492f2',
|
@@ -19,11 +19,10 @@ import datetime
|
|||||||
import mock
|
import mock
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from watcherclient.tests.v1.osc import base
|
from watcherclient import shell
|
||||||
|
from watcherclient.tests.v1 import base
|
||||||
from watcherclient import v1 as resource
|
from watcherclient import v1 as resource
|
||||||
from watcherclient.v1 import resource_fields
|
from watcherclient.v1 import resource_fields
|
||||||
from watcherclient import watcher
|
|
||||||
|
|
||||||
|
|
||||||
GOAL_1 = {
|
GOAL_1 = {
|
||||||
'uuid': "fc087747-61be-4aad-8126-b701731ae836",
|
'uuid': "fc087747-61be-4aad-8126-b701731ae836",
|
||||||
@@ -64,7 +63,7 @@ class GoalShellTest(base.CommandTestCase):
|
|||||||
self.m_goal_mgr_cls.return_value = self.m_goal_mgr
|
self.m_goal_mgr_cls.return_value = self.m_goal_mgr
|
||||||
|
|
||||||
self.stdout = six.StringIO()
|
self.stdout = six.StringIO()
|
||||||
self.cmd = watcher.WatcherShell(stdout=self.stdout)
|
self.cmd = shell.WatcherShell(stdout=self.stdout)
|
||||||
|
|
||||||
def test_do_goal_list(self):
|
def test_do_goal_list(self):
|
||||||
goal1 = resource.Goal(mock.Mock(), GOAL_1)
|
goal1 = resource.Goal(mock.Mock(), GOAL_1)
|
@@ -19,10 +19,10 @@ import datetime
|
|||||||
import mock
|
import mock
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from watcherclient.tests.v1.osc import base
|
from watcherclient import shell
|
||||||
|
from watcherclient.tests.v1 import base
|
||||||
from watcherclient import v1 as resource
|
from watcherclient import v1 as resource
|
||||||
from watcherclient.v1 import resource_fields
|
from watcherclient.v1 import resource_fields
|
||||||
from watcherclient import watcher as shell
|
|
||||||
|
|
||||||
STRATEGY_1 = {
|
STRATEGY_1 = {
|
||||||
'uuid': '2cf86250-d309-4b81-818e-1537f3dba6e5',
|
'uuid': '2cf86250-d309-4b81-818e-1537f3dba6e5',
|
Reference in New Issue
Block a user