Esempio n. 1
0
 def _report_state(self):
     """
     Reports the state of the agent back to the controller.  Controller
     knows that if a response isn't provided in a certain period of time
     then the agent is dead.  This call simply tells the controller that
     the agent is alive.
     """
     # TODO(thorst) provide some level of devices connected to this agent.
     try:
         device_count = 0
         self.agent_state.get("configurations")["devices"] = device_count
         self.state_rpc.report_state(self.context, self.agent_state)
         self.agent_state.pop("start_flag", None)
     except Exception:
         LOG.exception(_("Failed reporting state!"))
Esempio n. 2
0
 def _report_state(self):
     """
     Reports the state of the agent back to the controller.  Controller
     knows that if a response isn't provided in a certain period of time
     then the agent is dead.  This call simply tells the controller that
     the agent is alive.
     """
     # TODO(thorst) provide some level of devices connected to this agent.
     try:
         device_count = 0
         self.agent_state.get('configurations')['devices'] = device_count
         self.state_rpc.report_state(self.context, self.agent_state)
         self.agent_state.pop('start_flag', None)
     except Exception:
         LOG.exception(_("Failed reporting state!"))
Esempio n. 3
0
from networking_powervm.plugins.ibm.agent.powervm.i18n import _
from networking_powervm.plugins.ibm.agent.powervm.i18n import _LI
from networking_powervm.plugins.ibm.agent.powervm.i18n import _LW
from networking_powervm.plugins.ibm.agent.powervm import utils

import time


LOG = logging.getLogger(__name__)


agent_opts = [
    cfg.IntOpt(
        "exception_interval",
        default=5,
        help=_("The number of seconds agent will wait between " "polling when exception is caught"),
    ),
    cfg.IntOpt(
        "polling_interval",
        default=2,
        help=_("The number of seconds the agent will wait between " "polling for local device changes."),
    ),
    cfg.IntOpt(
        "heal_and_optimize_interval",
        default=300,
        help=_(
            "The number of seconds the agent should wait between "
            "heal/optimize intervals.  Should be higher than the "
            "polling_interval as it runs in the nearest polling "
            "loop."
        ),
Esempio n. 4
0
from pypowervm.helpers import vios_busy as vio_hlp
from pypowervm.utils import uuid as pvm_uuid

from networking_powervm.plugins.ibm.agent.powervm.i18n import _
from networking_powervm.plugins.ibm.agent.powervm.i18n import _LI
from networking_powervm.plugins.ibm.agent.powervm.i18n import _LW
from networking_powervm.plugins.ibm.agent.powervm import utils

import time

LOG = logging.getLogger(__name__)

agent_opts = [
    cfg.IntOpt('exception_interval',
               default=5,
               help=_("The number of seconds agent will wait between "
                      "polling when exception is caught")),
    cfg.IntOpt('polling_interval',
               default=2,
               help=_("The number of seconds the agent will wait between "
                      "polling for local device changes.")),
    cfg.IntOpt('heal_and_optimize_interval',
               default=300,
               help=_('The number of seconds the agent should wait between '
                      'heal/optimize intervals.  Should be higher than the '
                      'polling_interval as it runs in the nearest polling '
                      'loop.'))
]

cfg.CONF.register_opts(agent_opts, "AGENT")
a_config.register_agent_state_opts_helper(cfg.CONF)
a_config.register_root_helper(cfg.CONF)