# implied. # See the License for the specific language governing permissions and # limitations under the License. import os import eventlet from oslo.config import cfg from nova import exception from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova.servicegroup import api from nova import utils evzookeeper = importutils.try_import('evzookeeper') membership = importutils.try_import('evzookeeper.membersip') zookeeper = importutils.try_import('zookeeper') zk_driver_opts = [ cfg.StrOpt('address', default=None, help='The ZooKeeper addresses for servicegroup service in the ' 'format of host1:port,host2:port,host3:port'), cfg.IntOpt('recv_timeout', default=4000, help='recv_timeout parameter for the zk session'), cfg.StrOpt('sg_prefix', default="/servicegroups", help='The prefix used in ZooKeeper to store ephemeral nodes'), cfg.IntOpt('sg_retry_interval',
except ImportError: # Python 2.6 UnsupportedOperation = None import eventlet from eventlet import event from oslo.config import cfg from nova.openstack.common import eventlet_backdoor from nova.openstack.common.gettextutils import _ # noqa from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova.openstack.common import threadgroup rpc = importutils.try_import('nova.rpc') CONF = cfg.CONF LOG = logging.getLogger(__name__) def _sighup_supported(): return hasattr(signal, 'SIGHUP') def _is_daemon(): # The process group for a foreground process will match the # process group of the controlling terminal. If those values do # not match, or ioctl() fails on the stdout file handle, we assume # the process is running in the background as a daemon. # http://www.gnu.org/software/bash/manual/bashref.html#Job-Control-Basics try:
import socket import sys import types import uuid import eventlet import greenlet from nova.openstack.common import cfg from nova.openstack.common.gettextutils import _ from nova.openstack.common import importutils from nova.openstack.common import jsonutils from nova.openstack.common import processutils as utils from nova.openstack.common.rpc import common as rpc_common zmq = importutils.try_import('eventlet.green.zmq') # for convenience, are not modified. pformat = pprint.pformat Timeout = eventlet.timeout.Timeout LOG = rpc_common.LOG RemoteError = rpc_common.RemoteError RPCException = rpc_common.RPCException zmq_opts = [ cfg.StrOpt('rpc_zmq_bind_address', default='*', help='ZeroMQ bind address. Should be a wildcard (*), ' 'an ethernet interface, or IP. ' 'The "host" option should point or resolve to this ' 'address.'),
from io import UnsupportedOperation # noqa except ImportError: # Python 2.6 UnsupportedOperation = None import eventlet from eventlet import event from oslo.config import cfg from nova.openstack.common import eventlet_backdoor from nova.openstack.common.gettextutils import _ # noqa from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova.openstack.common import threadgroup rpc = importutils.try_import('nova.rpc') CONF = cfg.CONF LOG = logging.getLogger(__name__) def _sighup_supported(): return hasattr(signal, 'SIGHUP') def _is_daemon(): # The process group for a foreground process will match the # process group of the controlling terminal. If those values do # not match, or ioctl() fails on the stdout file handle, we assume # the process is running in the background as a daemon. # http://www.gnu.org/software/bash/manual/bashref.html#Job-Control-Basics try:
"""The bare-metal admin extension with Ironic Proxy.""" import netaddr from oslo.config import cfg import webob from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova.api.openstack import xmlutil from nova import exception from nova.i18n import _ from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova.virt.baremetal import db ironic_client = importutils.try_import('ironicclient.client') authorize = extensions.extension_authorizer('compute', 'baremetal_nodes') node_fields = [ 'id', 'cpus', 'local_gb', 'memory_mb', 'pm_address', 'pm_user', 'service_host', 'terminal_port', 'instance_uuid' ] node_ext_fields = ['uuid', 'task_state', 'updated_at', 'pxe_config_path'] interface_fields = ['id', 'address', 'datapath_id', 'port_no'] CONF = cfg.CONF CONF.import_opt('api_version', 'nova.virt.ironic.driver', group='ironic')
try: import simplejson as json except ImportError: import json else: import json import six import six.moves.xmlrpc_client as xmlrpclib from nova.openstack.common import gettextutils from nova.openstack.common import importutils from nova.openstack.common import strutils from nova.openstack.common import timeutils netaddr = importutils.try_import("netaddr") _nasty_type_tests = [inspect.ismodule, inspect.isclass, inspect.ismethod, inspect.isfunction, inspect.isgeneratorfunction, inspect.isgenerator, inspect.istraceback, inspect.isframe, inspect.iscode, inspect.isbuiltin, inspect.isroutine, inspect.isabstract] _simple_types = (six.string_types + six.integer_types + (type(None), bool, float)) def to_primitive(value, convert_instances=False, convert_datetime=True, level=0, max_depth=3): """Convert a complex object into primitives.
# implied. # See the License for the specific language governing permissions and # limitations under the License. import os import eventlet from oslo.config import cfg from nova import exception from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova.openstack.common import loopingcall from nova.servicegroup import api evzookeeper = importutils.try_import("evzookeeper") membership = importutils.try_import("evzookeeper.membersip") zookeeper = importutils.try_import("zookeeper") zk_driver_opts = [ cfg.StrOpt( "address", default=None, help="The ZooKeeper addresses for servicegroup service in the " "format of host1:port,host2:port,host3:port", ), cfg.IntOpt("recv_timeout", default=4000, help="recv_timeout parameter for the zk session"), cfg.StrOpt("sg_prefix", default="/servicegroups", help="The prefix used in ZooKeeper to store ephemeral nodes"), cfg.IntOpt("sg_retry_interval", default=5, help="Number of seconds to wait until retrying to join the " "session"), ] CONF = cfg.CONF
except ImportError: # Python 2.6 UnsupportedOperation = None import eventlet from eventlet import event from oslo.config import cfg from nova.openstack.common import eventlet_backdoor from nova.openstack.common.gettextutils import _ # noqa from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova.openstack.common import threadgroup rpc = importutils.try_import("nova.openstack.common.rpc") CONF = cfg.CONF LOG = logging.getLogger(__name__) def _sighup_supported(): return hasattr(signal, "SIGHUP") def _is_daemon(): # The process group for a foreground process will match the # process group of the controlling terminal. If those values do # not match, or ioctl() fails on the stdout file handle, we assume # the process is running in the background as a daemon. # http://www.gnu.org/software/bash/manual/bashref.html#Job-Control-Basics try:
"""The bare-metal admin extension with Ironic Proxy.""" import netaddr from oslo.config import cfg import webob from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova.api.openstack import xmlutil from nova import exception from nova.i18n import _ from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova.virt.baremetal import db ironic_client = importutils.try_import('ironicclient.client') ironic_exc = importutils.try_import('ironicclient.exc') authorize = extensions.extension_authorizer('compute', 'baremetal_nodes') node_fields = ['id', 'cpus', 'local_gb', 'memory_mb', 'pm_address', 'pm_user', 'service_host', 'terminal_port', 'instance_uuid'] node_ext_fields = ['uuid', 'task_state', 'updated_at', 'pxe_config_path'] interface_fields = ['id', 'address', 'datapath_id', 'port_no'] CONF = cfg.CONF CONF.import_opt('api_version', 'nova.virt.ironic.driver',
# Python 2.6 UnsupportedOperation = None import eventlet from eventlet import event from oslo.config import cfg from nova.openstack.common import eventlet_backdoor from nova.openstack.common.gettextutils import _LE, _LI, _LW from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova.openstack.common import systemd from nova.openstack.common import threadgroup rpc = importutils.try_import('nova.openstack.common.rpc') CONF = cfg.CONF LOG = logging.getLogger(__name__) def _sighup_supported(): return hasattr(signal, 'SIGHUP') def _is_daemon(): # The process group for a foreground process will match the # process group of the controlling terminal. If those values do # not match, or ioctl() fails on the stdout file handle, we assume # the process is running in the background as a daemon. # http://www.gnu.org/software/bash/manual/bashref.html#Job-Control-Basics try:
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """ The MatchMaker classes should accept a Topic or Fanout exchange key and return keys for direct exchanges, per (approximate) AMQP parlance. """ from oslo.config import cfg from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova.openstack.common.rpc import matchmaker as mm_common redis = importutils.try_import('redis') matchmaker_redis_opts = [ cfg.StrOpt('host', default='127.0.0.1', help='Host to locate redis'), cfg.IntOpt('port', default=6379, help='Use this port to connect to redis host.'), cfg.StrOpt('password', default=None, help='Password for Redis server. (optional)'), ] CONF = cfg.CONF
from eventlet import db_pool from eventlet import greenthread from oslo.config import cfg from sqlalchemy.exc import DisconnectionError, OperationalError, IntegrityError import sqlalchemy.interfaces import sqlalchemy.orm from sqlalchemy.pool import NullPool, StaticPool from sqlalchemy.sql.expression import literal_column from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova.openstack.common.gettextutils import _ from nova.openstack.common import timeutils MySQLdb = importutils.try_import('MySQLdb') if MySQLdb is not None: from MySQLdb.constants import CLIENT as mysql_client_constants sql_opts = [ cfg.StrOpt('sql_connection', default='sqlite:///' + os.path.abspath(os.path.join(os.path.dirname(__file__), '../', '$sqlite_db')), help='The SQLAlchemy connection string used to connect to the ' 'database'), cfg.StrOpt('sqlite_db', default='nova.sqlite', help='the filename to use with sqlite'), cfg.IntOpt('sql_idle_timeout', default=3600,
"""The bare-metal admin extension with Ironic Proxy.""" import netaddr from oslo.config import cfg import webob from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova.api.openstack import xmlutil from nova import exception from nova.i18n import _ from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova.virt.baremetal import db ironic_client = importutils.try_import('ironicclient.client') authorize = extensions.extension_authorizer('compute', 'baremetal_nodes') node_fields = ['id', 'cpus', 'local_gb', 'memory_mb', 'pm_address', 'pm_user', 'service_host', 'terminal_port', 'instance_uuid'] node_ext_fields = ['uuid', 'task_state', 'updated_at', 'pxe_config_path'] interface_fields = ['id', 'address', 'datapath_id', 'port_no'] CONF = cfg.CONF CONF.import_opt('api_version', 'nova.virt.ironic.driver', group='ironic')
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """ The MatchMaker classes should accept a Topic or Fanout exchange key and return keys for direct exchanges, per (approximate) AMQP parlance. """ from oslo.config import cfg from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova.openstack.common.rpc import matchmaker as mm_common redis = importutils.try_import('redis') matchmaker_redis_opts = [ cfg.StrOpt('host', default='127.0.0.1', help='Host to locate redis'), cfg.IntOpt('port', default=6379, help='Use this port to connect to redis host.'), cfg.StrOpt('password', default=None, help='Password for Redis server. (optional)'), ] CONF = cfg.CONF opt_group = cfg.OptGroup(name='matchmaker_redis', title='Options for Redis-based MatchMaker') CONF.register_group(opt_group)
import socket import sys import types import uuid import eventlet import greenlet from oslo.config import cfg from nova.openstack.common import excutils from nova.openstack.common.gettextutils import _ # noqa from nova.openstack.common import importutils from nova.openstack.common import jsonutils from nova.openstack.common.rpc import common as rpc_common zmq = importutils.try_import('eventlet.green.zmq') # for convenience, are not modified. pformat = pprint.pformat Timeout = eventlet.timeout.Timeout LOG = rpc_common.LOG RemoteError = rpc_common.RemoteError RPCException = rpc_common.RPCException zmq_opts = [ cfg.StrOpt('rpc_zmq_bind_address', default='*', help='ZeroMQ bind address. Should be a wildcard (*), ' 'an ethernet interface, or IP. ' 'The "host" option should point or resolve to this ' 'address.'),
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # # iBoot Power Driver from nova import context as nova_context from nova import exception from nova.openstack.common.gettextutils import _ from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova.virt.baremetal import baremetal_states from nova.virt.baremetal import base iboot = importutils.try_import('iboot') LOG = logging.getLogger(__name__) class IBootManager(base.PowerManager): """iBoot Power Driver for Baremetal Nova Compute This PowerManager class provides a mechanism for controlling power state via an iBoot capable device (tested with an iBoot G2). Requires installation of python-iboot: https://github.com/darkip/python-iboot
import socket import sys import types import uuid import eventlet import greenlet from oslo.config import cfg from nova.openstack.common import excutils from nova.openstack.common.gettextutils import _ # noqa from nova.openstack.common import importutils from nova.openstack.common import jsonutils from nova.openstack.common.rpc import common as rpc_common zmq = importutils.try_import("eventlet.green.zmq") # for convenience, are not modified. pformat = pprint.pformat Timeout = eventlet.timeout.Timeout LOG = rpc_common.LOG RemoteError = rpc_common.RemoteError RPCException = rpc_common.RPCException zmq_opts = [ cfg.StrOpt( "rpc_zmq_bind_address", default="*", help="ZeroMQ bind address. Should be a wildcard (*), " "an ethernet interface, or IP. " 'The "host" option should point or resolve to this '
import itertools import time import uuid import eventlet import greenlet from oslo.config import cfg from nova.openstack.common.gettextutils import _ from nova.openstack.common import importutils from nova.openstack.common import jsonutils from nova.openstack.common import log as logging from nova.openstack.common.rpc import amqp as rpc_amqp from nova.openstack.common.rpc import common as rpc_common qpid_messaging = importutils.try_import("qpid.messaging") qpid_exceptions = importutils.try_import("qpid.messaging.exceptions") LOG = logging.getLogger(__name__) qpid_opts = [ cfg.StrOpt('qpid_hostname', default='localhost', help='Qpid broker hostname'), cfg.IntOpt('qpid_port', default=5672, help='Qpid broker port'), cfg.ListOpt('qpid_hosts', default=['$qpid_hostname:$qpid_port'], help='Qpid HA cluster host:port pairs'), cfg.StrOpt('qpid_username',
# Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # # iBoot Power Driver from nova import exception from nova.openstack.common.gettextutils import _ from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova.virt.baremetal import baremetal_states from nova.virt.baremetal import base iboot = importutils.try_import("iboot") LOG = logging.getLogger(__name__) class IBootManager(base.PowerManager): """iBoot Power Driver for Baremetal Nova Compute This PowerManager class provides a mechanism for controlling power state via an iBoot capable device (tested with an iBoot G2). Requires installation of python-iboot: https://github.com/darkip/python-iboot
# Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # # iBoot Power Driver from nova import exception from nova.i18n import _ from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova.virt.baremetal import baremetal_states from nova.virt.baremetal import base iboot = importutils.try_import('iboot') LOG = logging.getLogger(__name__) class IBootManager(base.PowerManager): """iBoot Power Driver for Baremetal Nova Compute This PowerManager class provides a mechanism for controlling power state via an iBoot capable device (tested with an iBoot G2). Requires installation of python-iboot: https://github.com/darkip/python-iboot """
import itertools import time import uuid import eventlet import greenlet from oslo.config import cfg from nova.openstack.common.gettextutils import _ from nova.openstack.common import importutils from nova.openstack.common import jsonutils from nova.openstack.common import log as logging from nova.openstack.common.rpc import amqp as rpc_amqp from nova.openstack.common.rpc import common as rpc_common qpid_messaging = importutils.try_import("qpid.messaging") qpid_exceptions = importutils.try_import("qpid.messaging.exceptions") LOG = logging.getLogger(__name__) qpid_opts = [ cfg.StrOpt('qpid_hostname', default='localhost', help='Qpid broker hostname'), cfg.StrOpt('qpid_port', default='5672', help='Qpid broker port'), cfg.ListOpt('qpid_hosts', default=['$qpid_hostname:$qpid_port'], help='Qpid HA cluster host:port pairs'), cfg.StrOpt('qpid_username', default='', help='Username for qpid connection'),
import datetime import functools import inspect import itertools import json import six import six.moves.xmlrpc_client as xmlrpclib from nova.openstack.common import gettextutils from nova.openstack.common import importutils from nova.openstack.common import timeutils netaddr = importutils.try_import("netaddr") _nasty_type_tests = [inspect.ismodule, inspect.isclass, inspect.ismethod, inspect.isfunction, inspect.isgeneratorfunction, inspect.isgenerator, inspect.istraceback, inspect.isframe, inspect.iscode, inspect.isbuiltin, inspect.isroutine, inspect.isabstract] _simple_types = (six.string_types + six.integer_types + (type(None), bool, float)) def to_primitive(value, convert_instances=False, convert_datetime=True, level=0, max_depth=3): """Convert a complex object into primitives.
"""The bare-metal admin extension with Ironic Proxy.""" import netaddr from oslo.config import cfg import webob from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova.api.openstack import xmlutil from nova import exception from nova.i18n import _ from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova.virt.baremetal import db ironic_client = importutils.try_import('ironicclient.client') ironic_exc = importutils.try_import('ironicclient.exc') authorize = extensions.extension_authorizer('compute', 'baremetal_nodes') node_fields = [ 'id', 'cpus', 'local_gb', 'memory_mb', 'pm_address', 'pm_user', 'service_host', 'terminal_port', 'instance_uuid' ] node_ext_fields = ['uuid', 'task_state', 'updated_at', 'pxe_config_path'] interface_fields = ['id', 'address', 'datapath_id', 'port_no'] CONF = cfg.CONF