# coding: utf-8
from zope.interface import Interface


class IManager(Interface):
  """Manager is called in every step of preparation of the compute_node."""

  def __init__(config):
    """Manager needs to know config for its functioning.

    :param conf: dictionary-like object with full access to [slapos] section of the config file
    """

  def format(compute_node):
    """Method called at `slapos node format` phase.

    :param compute_node: slapos.format.ComputeNode, currently formatted compute_node
    """

  def formatTearDown(compute_node):
    """Method called after `slapos node format` phase.

    :param compute_node: slapos.format.ComputeNode, formatted compute_node
    """

  def software(software):
    """Method called at `slapos node software` phase.

    :param software: slapos.grid.SlapObject.Software, currently processed software
    """

  def softwareTearDown(software):
    """Method called after `slapos node software` phase.

    :param compute_node: slapos.grid.SlapObject.Software, processed software
    """

  def instance(partition):
    """Method called at `slapos node instance` phase.

    :param partition: slapos.grid.SlapObject.Partition, currently processed partition
    """

  def instanceTearDown(partition):
    """Method  called after `slapos node instance` phase.

    :param partition: slapos.grid.SlapObject.Partition, processed partition
    """

  def report(partition):
    """Method called at `slapos node report` phase.

    :param partition: slapos.grid.SlapObject.Partition, currently processed partition
    """
