Beispiel #1
0
trusted_opts = [
    cfg.StrOpt('server', default=None, help='attestation server http'),
    cfg.StrOpt('server_ca_file',
               default=None,
               help='attestation server Cert file for Identity verification'),
    cfg.StrOpt('port', default='8443', help='attestation server port'),
    cfg.StrOpt('api_url',
               default='/OpenAttestationWebServices/V1.0',
               help='attestation web API URL'),
    cfg.StrOpt('auth_blob',
               default=None,
               help='attestation authorization blob - must change'),
]

FLAGS = flags.FLAGS
trust_group = cfg.OptGroup(name='trusted_computing', title='Trust parameters')
FLAGS.register_group(trust_group)
FLAGS.register_opts(trusted_opts, group='trusted_computing')


class HTTPSClientAuthConnection(httplib.HTTPSConnection):
    """
    Class to make a HTTPS connection, with support for full client-based
    SSL Authentication
    """
    def __init__(self, host, port, key_file, cert_file, ca_file, timeout=None):
        httplib.HTTPSConnection.__init__(self,
                                         host,
                                         key_file=key_file,
                                         cert_file=cert_file)
        self.host = host
Beispiel #2
0
opts = [
    cfg.StrOpt('terminal',
               default='shellinaboxd',
               help='path to baremetal terminal program'),
    cfg.StrOpt('terminal_cert_dir',
               default=None,
               help='path to baremetal terminal SSL cert(PEM)'),
    cfg.StrOpt('terminal_pid_dir',
               default=paths.state_path_def('baremetal/console'),
               help='path to directory stores pidfiles of baremetal_terminal'),
    cfg.IntOpt('ipmi_power_retry',
               default=5,
               help='maximal number of retries for IPMI operations'),
    ]

baremetal_group = cfg.OptGroup(name='baremetal',
                               title='Baremetal Options')

CONF = cfg.CONF
CONF.register_group(baremetal_group)
CONF.register_opts(opts, baremetal_group)

LOG = logging.getLogger(__name__)


def _make_password_file(password):
    fd, path = tempfile.mkstemp()
    os.fchmod(fd, stat.S_IRUSR | stat.S_IWUSR)
    with os.fdopen(fd, "w") as f:
        f.write(password)
    return path
Beispiel #3
0
'''messaging based notification driver, with message envelopes'''

from nova.openstack.common import cfg
from nova.openstack.common import context as req_context
from nova.openstack.common.gettextutils import _
from nova.openstack.common import log as logging
from nova.openstack.common import rpc

LOG = logging.getLogger(__name__)

notification_topic_opt = cfg.ListOpt(
    'topics', default=['notifications', ],
    help='AMQP topic(s) used for openstack notifications')

opt_group = cfg.OptGroup(name='rpc_notifier2',
                         title='Options for rpc_notifier2')

CONF = cfg.CONF
CONF.register_group(opt_group)
CONF.register_opt(notification_topic_opt, opt_group)


def notify(context, message):
    """Sends a notification via RPC"""
    if not context:
        context = req_context.get_admin_context()
    priority = message.get('priority',
                           CONF.default_notification_level)
    priority = priority.lower()
    for topic in CONF.rpc_notifier2.topics:
        topic = '%s.%s' % (topic, priority)
Beispiel #4
0
from nova.conductor import manager
from nova.conductor import rpcapi
from nova.openstack.common import cfg

conductor_opts = [
    cfg.BoolOpt('use_local',
                default=False,
                help='Perform nova-conductor operations locally'),
    cfg.StrOpt('topic',
               default='conductor',
               help='the topic conductor nodes listen on'),
    cfg.StrOpt('manager',
               default='nova.conductor.manager.ConductorManager',
               help='full class name for the Manager for conductor'),
]
conductor_group = cfg.OptGroup(name='conductor', title='Conductor Options')
CONF = cfg.CONF
CONF.register_group(conductor_group)
CONF.register_opts(conductor_opts, conductor_group)


class LocalAPI(object):
    """A local version of the conductor API that does database updates
    locally instead of via RPC"""
    def __init__(self):
        self._manager = manager.ConductorManager()

    def instance_update(self, context, instance_uuid, **updates):
        """Perform an instance update in the database"""
        return self._manager.instance_update(context, instance_uuid, updates)