Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add minion_manager.rpc.client.py/tasks.py unit tests #321

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions coriolis/minion_manager/rpc/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def _get_task_name(self, action_id):
def _confirm_machine_allocation_for_action(
self, context, action_id, machine_allocations):
raise NotImplementedError(
"No minion allocation confrimation operation defined")
"No minion allocation confirmation operation defined")

def execute(self, context):
machines_cache = {}
Expand Down Expand Up @@ -646,7 +646,7 @@ def execute(self, context, origin, destination, task_info):
raise exception.InvalidMinionPoolSelection(
"[Task '%s'] Minion pool '%s' doesn't exist in the DB. "
"It cannot have shared resources deployed for it." % (
self._task_name))
self._task_name, self._minion_pool_id))
if minion_pool.shared_resources:
raise exception.InvalidMinionPoolState(
"[Task '%s'] Minion pool already has shared resources "
Expand Down Expand Up @@ -1096,7 +1096,7 @@ def execute(self, context, origin, destination, task_info):
self._task_name, self._minion_machine_id)
base_msg = (
"Could not find minion machine DB entry with ID '%s' for "
"healtcheck." % self._minion_machine_id)
"healthcheck." % self._minion_machine_id)
self._add_minion_pool_event(
context,
"%s Reporting healthcheck as failed" % base_msg,
Expand Down Expand Up @@ -1127,7 +1127,7 @@ def execute(self, context, origin, destination, task_info):

self._add_minion_pool_event(
context,
"Healthchecking minion machine with internal pool ID '%s'" % (
"Healthchecking minion machine with internal pool ID '%s'" % (
self._minion_machine_id))

execution_info = {
Expand All @@ -1138,19 +1138,19 @@ def execute(self, context, origin, destination, task_info):
context, origin, destination, execution_info)
self._add_minion_pool_event(
context,
"Successfully healtchecked minion machine with internal "
"Successfully healthchecked minion machine with internal "
"pool ID '%s'" % self._minion_machine_id)
self._set_minion_machine_allocation_status(
context, self._minion_pool_id, self._minion_machine_id,
self._machine_status_on_success)
except Exception as ex:
self._add_minion_pool_event(
context,
"Healtcheck for machine with internal pool ID '%s' has "
"Healthcheck for machine with internal pool ID '%s' has "
"failed." % (self._minion_machine_id),
level=constants.TASK_EVENT_WARNING)
LOG.debug(
"[Task '%s'] Healtcheck failed for machine '%s' of pool '%s'. "
"[Task '%s'] Healthcheck failed for machine '%s' of pool '%s'."
"Full trace was:\n%s", self._task_name,
self._minion_machine_id, self._minion_pool_id,
utils.get_exception_details())
Expand Down Expand Up @@ -1191,7 +1191,7 @@ def __call__(self, history):
HealthcheckMinionMachineTask.get_healthcheck_task_name(
self._minion_pool_id, self._minion_machine_id))

if not history and healthcheck_task_name not in history:
if not history or healthcheck_task_name not in history:
LOG.warn(
"Could not find healthceck result for minion machine '%s' "
"of pool '%s' (task name '%s'). NOT greenlighting futher "
Expand Down Expand Up @@ -1287,7 +1287,7 @@ def execute(self, context, origin, destination, task_info):
context,
"Exception occurred while powering on minion machine with "
"internal pool ID '%s'. The minion machine will be marked "
"as ERROR'd and automatically redeployed later" % (
"as ERROR'd and automatically redeployed later." % (
self._minion_machine_id),
level=constants.TASK_EVENT_ERROR)
self._set_minion_machine_allocation_status(
Expand Down
Loading
Loading