Ejemplo n.º 1
0
 def __init__(self, api_url, advertise_address, listen_address,
              ip_lookup_attempts, ip_lookup_sleep, network_interface,
              lookup_timeout, lookup_interval, driver_name):
     super(IronicPythonAgent, self).__init__()
     self.ext_mgr = extension.ExtensionManager(
         namespace='ironic_python_agent.extensions',
         invoke_on_load=True,
         propagate_map_exceptions=True,
     )
     self.api_url = api_url
     self.driver_name = driver_name
     self.api_client = ironic_api_client.APIClient(self.api_url,
                                                   self.driver_name)
     self.listen_address = listen_address
     self.advertise_address = advertise_address
     self.version = pkg_resources.get_distribution('ironic-python-agent')\
         .version
     self.api = app.VersionSelectorApplication(self)
     self.heartbeater = IronicPythonAgentHeartbeater(self)
     self.heartbeat_timeout = None
     self.hardware = hardware.get_manager()
     self.log = log.getLogger(__name__)
     self.started_at = None
     self.node = None
     # lookup timeout in seconds
     self.lookup_timeout = lookup_timeout
     self.lookup_interval = lookup_interval
     self.ip_lookup_attempts = ip_lookup_attempts
     self.ip_lookup_sleep = ip_lookup_sleep
     self.network_interface = network_interface
Ejemplo n.º 2
0
 def __init__(self, api_url, advertise_address, listen_address,
              ip_lookup_attempts, ip_lookup_sleep, network_interface,
              lookup_timeout, lookup_interval, standalone,
              hardware_initialization_delay=0):
     super(IronicPythonAgent, self).__init__()
     if bool(cfg.CONF.keyfile) != bool(cfg.CONF.certfile):
         LOG.warning("Only one of 'keyfile' and 'certfile' options is "
                     "defined in config file. Its value will be ignored.")
     self.ext_mgr = extension.ExtensionManager(
         namespace='ironic_python_agent.extensions',
         invoke_on_load=True,
         propagate_map_exceptions=True,
         invoke_kwds={'agent': self},
     )
     self.api_url = api_url
     if self.api_url:
         self.api_client = ironic_api_client.APIClient(self.api_url)
         self.heartbeater = IronicPythonAgentHeartbeater(self)
     self.listen_address = listen_address
     self.advertise_address = advertise_address
     self.version = pkg_resources.get_distribution('ironic-python-agent')\
         .version
     self.api = app.VersionSelectorApplication(self)
     self.heartbeat_timeout = None
     self.started_at = None
     self.node = None
     # lookup timeout in seconds
     self.lookup_timeout = lookup_timeout
     self.lookup_interval = lookup_interval
     self.ip_lookup_attempts = ip_lookup_attempts
     self.ip_lookup_sleep = ip_lookup_sleep
     self.network_interface = network_interface
     self.standalone = standalone
     self.hardware_initialization_delay = hardware_initialization_delay
Ejemplo n.º 3
0
    def __init__(self,
                 api_url,
                 advertise_address,
                 listen_address,
                 ip_lookup_attempts,
                 ip_lookup_sleep,
                 network_interface,
                 lookup_timeout,
                 lookup_interval,
                 standalone,
                 hardware_initialization_delay=0):
        super(IronicPythonAgent, self).__init__()
        if bool(cfg.CONF.keyfile) != bool(cfg.CONF.certfile):
            LOG.warning("Only one of 'keyfile' and 'certfile' options is "
                        "defined in config file. Its value will be ignored.")
        self.ext_mgr = extension.ExtensionManager(
            namespace='ironic_python_agent.extensions',
            invoke_on_load=True,
            propagate_map_exceptions=True,
            invoke_kwds={'agent': self},
        )
        self.api_url = api_url
        if not self.api_url or self.api_url == 'mdns':
            try:
                self.api_url, params = mdns.get_endpoint('baremetal')
            except lib_exc.ServiceLookupFailure:
                if self.api_url:
                    # mDNS explicitly requested, report failure.
                    raise
                else:
                    # implicit fallback to mDNS, do not fail (maybe we're only
                    # running inspection).
                    LOG.warning('Could not get baremetal endpoint from mDNS, '
                                'will not heartbeat')
            else:
                config.override(params)

        if self.api_url:
            self.api_client = ironic_api_client.APIClient(self.api_url)
            self.heartbeater = IronicPythonAgentHeartbeater(self)
        self.listen_address = listen_address
        self.advertise_address = advertise_address
        self.version = pkg_resources.get_distribution('ironic-python-agent')\
            .version
        self.api = app.VersionSelectorApplication(self)
        self.heartbeat_timeout = None
        self.started_at = None
        self.node = None
        # lookup timeout in seconds
        self.lookup_timeout = lookup_timeout
        self.lookup_interval = lookup_interval
        self.ip_lookup_attempts = ip_lookup_attempts
        self.ip_lookup_sleep = ip_lookup_sleep
        self.network_interface = network_interface
        self.standalone = standalone
        self.hardware_initialization_delay = hardware_initialization_delay
        # IPA will stop serving requests and exit after this is set to False
        self.serve_api = True
        self.iscsi_started = False