Example #1
0
def main():
    config.parse_args(sys.argv)
    logging.setup("nova")
    global LOG
    LOG = logging.getLogger('nova.virt.baremetal.deploy_helper')
    app = BareMetalDeploy()
    srv = simple_server.make_server('', 10000, app)
    srv.serve_forever()
Example #2
0
 def __init__(self):
     self.vendor_routes = {
         'heartbeat': self._heartbeat
     }
     self.driver_routes = {
         'lookup': self._heartbeat_no_uuid
     }
     self.db_connection = dbapi.get_backend()
     self.LOG = log.getLogger(__name__)
Example #3
0
def notify(_context, message):
    """Notifies the recipient of the desired event given the model.
    Log notifications using openstack's default logging system"""

    priority = message.get('priority',
                           CONF.default_notification_level)
    priority = priority.lower()
    logger = logging.getLogger(
        'ironic.openstack.common.notification.%s' %
        message['event_type'])
    getattr(logger, priority)(jsonutils.dumps(message))
Example #4
0
def main():
    # Pase config file and command line options, then start logging
    ironic_service.prepare_service(sys.argv)

    # Build and start the WSGI app
    host = CONF.api.host_ip
    port = CONF.api.port
    wsgi = simple_server.make_server(host, port, app.VersionSelectorApplication(), server_class=ThreadedSimpleServer)

    LOG = log.getLogger(__name__)
    LOG.info(_LI("Serving on http://%(host)s:%(port)s"), {"host": host, "port": port})
    LOG.info(_LI("Configuration:"))
    CONF.log_opt_values(LOG, logging.INFO)

    try:
        wsgi.serve_forever()
    except KeyboardInterrupt:
        pass
Example #5
0
def main():
    # Pase config file and command line options, then start logging
    ironic_service.prepare_service(sys.argv)

    # Build and start the WSGI app
    host = CONF.ironic_api_bind_ip
    port = CONF.ironic_api_port
    wsgi = simple_server.make_server(
            host, port,
            app.VersionSelectorApplication())

    LOG = log.getLogger(__name__)
    LOG.info("Serving on http://%s:%s" % (host, port))
    LOG.info("Configuration:")
    CONF.log_opt_values(LOG, logging.INFO)

    try:
        wsgi.serve_forever()
    except KeyboardInterrupt:
        pass
Example #6
0
locked by each conductor when performing actions which change the state of that
node; these locks are represented by the
:py:class:`ironic.conductor.task_manager.TaskManager` class.
"""

from ironic.common import exception
from ironic.common import service
from ironic.common import states
from ironic.conductor import task_manager
from ironic.db import api as dbapi
from ironic.objects import base as objects_base
from ironic.openstack.common import log

MANAGER_TOPIC = 'ironic.conductor_manager'

LOG = log.getLogger(__name__)


class ConductorManager(service.PeriodicService):
    """Ironic Conductor service main class."""

    RPC_API_VERSION = '1.3'

    def __init__(self, host, topic):
        serializer = objects_base.IronicObjectSerializer()
        super(ConductorManager, self).__init__(host, topic,
                                               serializer=serializer)

    def start(self):
        super(ConductorManager, self).start()
        self.dbapi = dbapi.get_instance()
Example #7
0
"""Ironic common internal object model"""

import collections
import copy

from oslo import messaging
import six

from ironic.common import exception
from ironic.objects import utils as obj_utils
from ironic.openstack.common import context
from ironic.openstack.common import log as logging
from ironic.openstack.common import versionutils


LOG = logging.getLogger('object')


class NotSpecifiedSentinel:
    pass


def get_attrname(name):
    """Return the mangled name of the attribute's underlying storage."""
    return '_%s' % name


def make_class_properties(cls):
    # NOTE(danms/comstud): Inherit fields from super classes.
    # mro() returns the current class first and returns 'object' last, so
    # those can be skipped.  Also be careful to not overwrite any fields
Example #8
0
__author__ = 'mnachiappan'

import signal
import socket

from neutronclient.common import exceptions as neutron_client_exc
from neutronclient.v2_0 import client as clientv20
from oslo_config import cfg

from ironic.static import base
from ironic.common import exception
from ironic.common.i18n import _
from ironic.common import keystone
from ironic.openstack.common import log as logging

LOG = logging.getLogger(__name__)
CONF = cfg.CONF
CONF.import_opt('my_ip', 'ironic.netconf')

static_provider_opts = [
    cfg.StrOpt('static_provider',
               default=None,
               help='Static provider to use. "neutron" uses Neutron, and '
               '"none" uses a no-op provider.'),
]
CONF.register_opts(static_provider_opts)

neutron_opts = [
    cfg.StrOpt('url',
               default='http://$my_ip:9696',
               help='URL for connecting to neutron.'),
Example #9
0
 def __init__(self):
     self.session = requests.Session()
     self.log = log.getLogger(__name__)
#    License for the specific language governing permissions and limitations
#    under the License.

import os
import tempfile
import time

import mox

from ironic.cmd import ironic_deploy_helper as bmdh
from ironic.openstack.common import log as logging
from ironic.tests import base as tests_base
from ironic.tests.db import base
from ironic import db

bmdh.LOG = logging.getLogger('nova.virt.baremetal.deploy_helper')

_PXECONF_DEPLOY = """
default deploy

label deploy
kernel deploy_kernel
append initrd=deploy_ramdisk
ipappend 3

label boot
kernel kernel
append initrd=ramdisk root=${ROOT}
"""

_PXECONF_BOOT = """
Example #11
0
"""Ironic base exception handling.

Includes decorator for re-raising Ironic-type exceptions.

SHOULD include dedicated exception logging.

"""

from oslo.config import cfg
import six

from ironic.common.i18n import _
from ironic.common.i18n import _LE
from ironic.openstack.common import log as logging

LOG = logging.getLogger(__name__)

exc_log_opts = [
    cfg.BoolOpt('fatal_exception_format_errors',
                default=False,
                help='Make exception message format errors fatal.'),
]

CONF = cfg.CONF
CONF.register_opts(exc_log_opts)


def _cleanse_dict(original):
    """Strip all admin_password, new_pass, rescue_pass keys from a dict."""
    return dict((k, v) for k, v in original.iteritems() if "_pass" not in k)