Enabled config parameters to plugins

In this changeset, I added the possibility for all plugins to define
configuration parameters for themselves.

Partially Implements: blueprint plugins-parameters

Change-Id: I676b2583b3b4841c64c862b2b0c234b4eb5fd0fd
This commit is contained in:
Vincent Françoise
2016-05-09 09:32:27 +02:00
parent dcb5c1f9fc
commit 5aa6b16238
22 changed files with 453 additions and 129 deletions

View File

@@ -54,7 +54,8 @@ class TestChangeNovaServiceState(base.TestCase):
baction.BaseAction.RESOURCE_ID: "compute-1",
"state": hstate.HypervisorState.ENABLED.value,
}
self.action = change_nova_service_state.ChangeNovaServiceState()
self.action = change_nova_service_state.ChangeNovaServiceState(
mock.Mock())
self.action.input_parameters = self.input_parameters
def test_parameters_down(self):

View File

@@ -58,7 +58,7 @@ class TestMigration(base.TestCase):
"dst_hypervisor": "hypervisor2-hostname",
baction.BaseAction.RESOURCE_ID: self.INSTANCE_UUID,
}
self.action = migration.Migrate()
self.action = migration.Migrate(mock.Mock())
self.action.input_parameters = self.input_parameters
self.input_parameters_cold = {
@@ -67,7 +67,7 @@ class TestMigration(base.TestCase):
"dst_hypervisor": "hypervisor2-hostname",
baction.BaseAction.RESOURCE_ID: self.INSTANCE_UUID,
}
self.action_cold = migration.Migrate()
self.action_cold = migration.Migrate(mock.Mock())
self.action_cold.input_parameters = self.input_parameters_cold
def test_parameters(self):

View File

@@ -14,6 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
import mock
import voluptuous
from watcher.applier.actions import sleep
@@ -23,7 +25,7 @@ from watcher.tests import base
class TestSleep(base.TestCase):
def setUp(self):
super(TestSleep, self).setUp()
self.s = sleep.Sleep()
self.s = sleep.Sleep(mock.Mock())
def test_parameters_duration(self):
self.s.input_parameters = {self.s.DURATION: 1.0}