def test_check_parameters(self): model = self.fake_cluster.generate_scenario_3_with_2_nodes() self.m_model.return_value = model solution = self.strategy.execute() loader = default.DefaultActionLoader() for action in solution.actions: loaded_action = loader.load(action['action_type']) loaded_action.input_parameters = action['input_parameters'] loaded_action.validate_parameters()
def sync(self): ctx = context.make_context() action_loader = default.DefaultActionLoader() available_actions = action_loader.list_available() for action_type in available_actions.keys(): load_action = action_loader.load(action_type) load_description = load_action.get_description() try: action_desc = objects.ActionDescription.get_by_type( ctx, action_type) if action_desc.description != load_description: action_desc.description = load_description action_desc.save() except exception.ActionDescriptionNotFound: obj_action_desc = objects.ActionDescription(ctx) obj_action_desc.action_type = action_type obj_action_desc.description = load_description obj_action_desc.create()
def __init__(self): self.action_loader = default.DefaultActionLoader()
def setUp(self): super(TestDefaultActionLoader, self).setUp() self.loader = default.DefaultActionLoader()