Exemplo n.º 1
0
 def setUp(self):
     super(ConfFixture, self).setUp()
     self.conf.set_default('api_paste_config',
                           paths.state_path_def('etc/nova/api-paste.ini'))
     self.conf.set_default('host', 'fake-mini')
     self.conf.set_default('compute_driver', 'nova.virt.fake.FakeDriver')
     self.conf.set_default('fake_network', True)
     self.conf.set_default('flat_network_bridge', 'br100')
     self.conf.set_default('floating_ip_dns_manager',
                           'nova.tests.utils.dns_manager')
     self.conf.set_default('instance_dns_manager',
                           'nova.tests.utils.dns_manager')
     self.conf.set_default('network_size', 8)
     self.conf.set_default('num_networks', 2)
     self.conf.set_default('rpc_backend',
                           'nova.openstack.common.rpc.impl_fake')
     self.conf.set_default('rpc_cast_timeout', 5)
     self.conf.set_default('rpc_response_timeout', 5)
     self.conf.set_default('connection', "sqlite://", group='database')
     self.conf.set_default('sqlite_synchronous', False)
     self.conf.set_default('use_ipv6', True)
     self.conf.set_default('verbose', True)
     self.conf.set_default('vlan_interface', 'eth0')
     config.parse_args([], default_config_files=[])
     self.addCleanup(utils.cleanup_dns_managers)
     self.addCleanup(ipv6.api.reset_backend)
Exemplo n.º 2
0
 def setUp(self):
     super(ConfFixture, self).setUp()
     self.conf.set_default('api_paste_config',
                           paths.state_path_def('etc/nova/api-paste.ini'))
     self.conf.set_default('host', 'fake-mini')
     self.conf.set_default('compute_driver', 'nova.virt.fake.FakeDriver')
     self.conf.set_default('fake_network', True)
     self.conf.set_default('flat_network_bridge', 'br100')
     self.conf.set_default('floating_ip_dns_manager',
                           'nova.tests.utils.dns_manager')
     self.conf.set_default('instance_dns_manager',
                           'nova.tests.utils.dns_manager')
     self.conf.set_default('network_size', 8)
     self.conf.set_default('num_networks', 2)
     self.conf.set_default('rpc_backend',
                           'nova.openstack.common.rpc.impl_fake')
     self.conf.set_default('rpc_cast_timeout', 5)
     self.conf.set_default('rpc_response_timeout', 5)
     self.conf.set_default('connection', "sqlite://", group='database')
     self.conf.set_default('sqlite_synchronous', False)
     self.conf.set_default('use_ipv6', True)
     self.conf.set_default('verbose', True)
     self.conf.set_default('vlan_interface', 'eth0')
     config.parse_args([], default_config_files=[])
     self.addCleanup(utils.cleanup_dns_managers)
     self.addCleanup(ipv6.api.reset_backend)
Exemplo n.º 3
0
 def setUp(self):
     super(ConfFixture, self).setUp()
     self.conf.set_default('api_paste_config',
                           paths.state_path_def('etc/nova/api-paste.ini'))
     self.conf.set_default('host', 'fake-mini')
     self.conf.set_default('compute_driver',
                           'nova.virt.fake.SmallFakeDriver')
     self.conf.set_default('fake_network', True)
     self.conf.set_default('flat_network_bridge', 'br100')
     self.conf.set_default('floating_ip_dns_manager',
                           'nova.tests.unit.utils.dns_manager')
     self.conf.set_default('instance_dns_manager',
                           'nova.tests.unit.utils.dns_manager')
     self.conf.set_default('network_size', 8)
     self.conf.set_default('num_networks', 2)
     self.conf.set_default('use_ipv6', True)
     self.conf.set_default('vlan_interface', 'eth0')
     self.conf.set_default('auth_strategy', 'noauth2')
     config.parse_args([], default_config_files=[], configure_db=False)
     self.conf.set_default('connection', "sqlite://", group='database')
     self.conf.set_default('connection', "sqlite://", group='api_database')
     self.conf.set_default('sqlite_synchronous', False, group='database')
     self.conf.set_default('sqlite_synchronous', False,
             group='api_database')
     self.conf.set_default('fatal_exception_format_errors', True)
     self.conf.set_default('enabled', True, 'osapi_v21')
     self.conf.set_default('force_dhcp_release', False)
     self.conf.set_default('periodic_enable', False)
     policy_opts.set_defaults(self.conf)
     self.addCleanup(utils.cleanup_dns_managers)
     self.addCleanup(ipv6.api.reset_backend)
Exemplo n.º 4
0
 def setUp(self):
     super(ConfFixture, self).setUp()
     self.conf.set_default("api_paste_config", paths.state_path_def("etc/nova/api-paste.ini"))
     self.conf.set_default("host", "fake-mini")
     self.conf.set_default("compute_driver", "nova.virt.fake.SmallFakeDriver")
     self.conf.set_default("fake_network", True)
     self.conf.set_default("flat_network_bridge", "br100")
     self.conf.set_default("floating_ip_dns_manager", "nova.tests.unit.utils.dns_manager")
     self.conf.set_default("instance_dns_manager", "nova.tests.unit.utils.dns_manager")
     self.conf.set_default("network_size", 8)
     self.conf.set_default("num_networks", 2)
     self.conf.set_default("use_ipv6", True)
     self.conf.set_default("vlan_interface", "eth0")
     self.conf.set_default("auth_strategy", "noauth2")
     config.parse_args([], default_config_files=[], configure_db=False)
     self.conf.set_default("connection", "sqlite://", group="database")
     self.conf.set_default("connection", "sqlite://", group="api_database")
     self.conf.set_default("sqlite_synchronous", False, group="database")
     self.conf.set_default("sqlite_synchronous", False, group="api_database")
     self.conf.set_default("fatal_exception_format_errors", True)
     self.conf.set_default("enabled", True, "osapi_v21")
     self.conf.set_default("force_dhcp_release", False)
     self.conf.set_default("periodic_enable", False)
     policy_opts.set_defaults(self.conf)
     self.addCleanup(utils.cleanup_dns_managers)
     self.addCleanup(ipv6.api.reset_backend)
Exemplo n.º 5
0
 def setUp(self):
     super(ConfFixture, self).setUp()
     self.conf.set_default('api_paste_config',
                           paths.state_path_def('etc/nova/api-paste.ini'))
     self.conf.set_default('host', 'fake-mini')
     self.conf.set_default('compute_driver',
                           'nova.virt.fake.SmallFakeDriver')
     self.conf.set_default('fake_network', True)
     self.conf.set_default('flat_network_bridge', 'br100')
     self.conf.set_default('floating_ip_dns_manager',
                           'nova.tests.unit.utils.dns_manager')
     self.conf.set_default('instance_dns_manager',
                           'nova.tests.unit.utils.dns_manager')
     self.conf.set_default('network_size', 8)
     self.conf.set_default('num_networks', 2)
     self.conf.set_default('use_ipv6', True)
     self.conf.set_default('vlan_interface', 'eth0')
     self.conf.set_default('auth_strategy', 'noauth')
     config.parse_args([], default_config_files=[])
     self.conf.set_default('connection', "sqlite://", group='database')
     self.conf.set_default('sqlite_synchronous', False, group='database')
     self.conf.set_default('fatal_exception_format_errors', True)
     self.conf.set_default('enabled', True, 'osapi_v3')
     self.conf.set_default('force_dhcp_release', False)
     self.conf.set_default('periodic_enable', False)
     self.addCleanup(utils.cleanup_dns_managers)
     self.addCleanup(ipv6.api.reset_backend)
 def setUp(self):
     super(RealPolicyFixture, self).setUp()
     # policy_file can be overridden by subclasses
     self.policy_file = paths.state_path_def('etc/nova/policy.json')
     self._prepare_policy()
     CONF.set_override('policy_file', self.policy_file)
     nova.policy.reset()
     nova.policy.init()
     self.addCleanup(nova.policy.reset)
Exemplo n.º 7
0
 def setUp(self):
     super(RealPolicyFixture, self).setUp()
     # policy_file can be overridden by subclasses
     self.policy_file = paths.state_path_def('etc/nova/policy.json')
     self._prepare_policy()
     CONF.set_override('policy_file', self.policy_file, group='oslo_policy')
     nova.policy.reset()
     nova.policy.init()
     self.addCleanup(nova.policy.reset)
Exemplo n.º 8
0
 def setUp(self):
     super(ApiPasteV21Fixture, self).setUp()
     CONF.set_default('api_paste_config',
                      paths.state_path_def('etc/nova/api-paste.ini'))
     tmp_api_paste_dir = self.useFixture(fixtures.TempDir())
     tmp_api_paste_file_name = os.path.join(tmp_api_paste_dir.path,
                                            'fake_api_paste.ini')
     with open(CONF.api_paste_config, 'r') as orig_api_paste:
         with open(tmp_api_paste_file_name, 'w') as tmp_file:
             for line in orig_api_paste:
                 self._replace_line(tmp_file, line)
     CONF.set_override('api_paste_config', tmp_api_paste_file_name)
 def setUp(self):
     super(ApiPasteV21Fixture, self).setUp()
     CONF.set_default('api_paste_config',
                      paths.state_path_def('etc/nova/api-paste.ini'))
     tmp_api_paste_dir = self.useFixture(fixtures.TempDir())
     tmp_api_paste_file_name = os.path.join(tmp_api_paste_dir.path,
                                            'fake_api_paste.ini')
     with open(CONF.api_paste_config, 'r') as orig_api_paste:
         with open(tmp_api_paste_file_name, 'w') as tmp_file:
             for line in orig_api_paste:
                 self._replace_line(tmp_file, line)
     CONF.set_override('api_paste_config', tmp_api_paste_file_name)
Exemplo n.º 10
0
 def setUp(self):
     super(ApiPasteFixture, self).setUp()
     CONF.set_default('api_paste_config',
                      paths.state_path_def('etc/nova/api-paste.ini'))
     tmp_api_paste_dir = self.useFixture(fixtures.TempDir())
     tmp_api_paste_file_name = os.path.join(tmp_api_paste_dir.path,
                                            'fake_api_paste.ini')
     with open(CONF.api_paste_config, 'r') as orig_api_paste:
         with open(tmp_api_paste_file_name, 'w') as tmp_file:
             for line in orig_api_paste:
                 tmp_file.write(line.replace(
                     "/v2: openstack_compute_api_v2",
                     "/v2: openstack_compute_api_v21"))
     CONF.set_override('api_paste_config', tmp_api_paste_file_name)
Exemplo n.º 11
0
 def setUp(self):
     super(ConfFixture, self).setUp()
     self.conf.set_default('api_paste_config',
                           paths.state_path_def('etc/nova/api-paste.ini'))
     self.conf.set_default('host', 'fake-mini')
     self.conf.set_default('compute_driver',
                           'nova.virt.fake.SmallFakeDriver')
     self.conf.set_default('fake_network', True)
     self.conf.set_default('flat_network_bridge', 'br100')
     self.conf.set_default('floating_ip_dns_manager',
                           'nova.tests.unit.utils.dns_manager')
     self.conf.set_default('instance_dns_manager',
                           'nova.tests.unit.utils.dns_manager')
     self.conf.set_default('network_size', 8)
     self.conf.set_default('num_networks', 2)
     self.conf.set_default('use_ipv6', True)
     self.conf.set_default('vlan_interface', 'eth0')
     self.conf.set_default('auth_strategy', 'noauth2')
     config.parse_args([],
                       default_config_files=[],
                       configure_db=False,
                       init_rpc=False)
     self.conf.set_default('connection', "sqlite://", group='database')
     self.conf.set_default('connection', "sqlite://", group='api_database')
     self.conf.set_default('sqlite_synchronous', False, group='database')
     self.conf.set_default('sqlite_synchronous',
                           False,
                           group='api_database')
     self.conf.set_default('fatal_exception_format_errors', True)
     self.conf.set_default('enabled', True, 'osapi_v21')
     # TODO(sdague): this makes our project_id match 'fake' and
     # 'openstack' as well. We should fix the tests to use real
     # UUIDs then drop this work around.
     self.conf.set_default('project_id_regex', '[0-9a-fopnstk\-]+',
                           'osapi_v21')
     self.conf.set_default('force_dhcp_release', False)
     self.conf.set_default('periodic_enable', False)
     policy_opts.set_defaults(self.conf)
     self.addCleanup(utils.cleanup_dns_managers)
     self.addCleanup(ipv6.api.reset_backend)
Exemplo n.º 12
0
 def setUp(self):
     super(ConfFixture, self).setUp()
     self.conf.set_default('state_path', os.path.abspath(
         os.path.join(os.path.dirname(__file__), '..', '..')))
     self.conf.set_default('api_paste_config',
                           paths.state_path_def('etc/nova/api-paste.ini'))
     self.conf.set_default('host', 'fake-mini')
     self.conf.set_default('compute_driver', 'nova.virt.fake.FakeDriver')
     self.conf.set_default('fake_network', True)
     self.conf.set_default('flat_network_bridge', 'br100')
     self.conf.set_default('floating_ip_dns_manager',
                           'nova.tests.utils.dns_manager')
     self.conf.set_default('instance_dns_manager',
                           'nova.tests.utils.dns_manager')
     self.conf.set_default('network_size', 8)
     self.conf.set_default('num_networks', 2)
     self.conf.set_default('connection', "sqlite://", group='database')
     self.conf.set_default('sqlite_synchronous', False, group='database')
     self.conf.set_default('use_ipv6', True)
     self.conf.set_default('vlan_interface', 'eth0')
     config.parse_args([], default_config_files=[])
     self.addCleanup(utils.cleanup_dns_managers)
     self.addCleanup(ipv6.api.reset_backend)
Exemplo n.º 13
0
 def setUp(self):
     super(ConfFixture, self).setUp()
     self.conf.set_default('api_paste_config',
                           paths.state_path_def('etc/nova/api-paste.ini'),
                           group='wsgi')
     self.conf.set_default('host', 'fake-mini')
     self.conf.set_default('compute_driver',
                           'nova.virt.fake.SmallFakeDriver')
     self.conf.set_default('fake_network', True)
     self.conf.set_default('flat_network_bridge', 'br100')
     self.conf.set_default('floating_ip_dns_manager',
                           'nova.tests.unit.utils.dns_manager')
     self.conf.set_default('instance_dns_manager',
                           'nova.tests.unit.utils.dns_manager')
     self.conf.set_default('network_size', 8)
     self.conf.set_default('num_networks', 2)
     self.conf.set_default('use_ipv6', True)
     self.conf.set_default('vlan_interface', 'eth0')
     self.conf.set_default('auth_strategy', 'noauth2')
     config.parse_args([], default_config_files=[], configure_db=False,
                       init_rpc=False)
     self.conf.set_default('connection', "sqlite://", group='database')
     self.conf.set_default('connection', "sqlite://", group='api_database')
     self.conf.set_default('sqlite_synchronous', False, group='database')
     self.conf.set_default('sqlite_synchronous', False,
             group='api_database')
     self.conf.set_default('fatal_exception_format_errors', True)
     # TODO(sdague): this makes our project_id match 'fake' as well.
     # We should fix the tests to use real
     # UUIDs then drop this work around.
     self.conf.set_default('project_id_regex',
                           '[0-9a-fk\-]+', 'osapi_v21')
     self.conf.set_default('force_dhcp_release', False)
     self.conf.set_default('periodic_enable', False)
     policy_opts.set_defaults(self.conf)
     self.addCleanup(utils.cleanup_dns_managers)
     self.addCleanup(ipv6.api.reset_backend)
Exemplo n.º 14
0
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    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.

from oslo.config import cfg

from nova import debugger
from nova.openstack.common.db import options
from nova import paths
from nova import rpc
from nova import version

_DEFAULT_SQL_CONNECTION = 'sqlite:///' + paths.state_path_def('nova.sqlite')


def parse_args(argv, default_config_files=None):
    options.set_defaults(sql_connection=_DEFAULT_SQL_CONNECTION,
                         sqlite_db='nova.sqlite')
    rpc.set_defaults(control_exchange='nova')
    debugger.register_cli_opts()
    cfg.CONF(argv[1:],
             project='nova',
             version=version.version_string(),
             default_config_files=default_config_files)
    rpc.init(cfg.CONF)
Exemplo n.º 15
0
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

import nova.exception
from nova.openstack.common import cfg
import nova.openstack.common.log as logging
from nova.openstack.common import timeutils
from nova import paths


sql_opts = [
    cfg.StrOpt('sql_connection',
               default='sqlite:///' + paths.state_path_def('$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,
               help='timeout before idle sql connections are reaped'),
    cfg.BoolOpt('sqlite_synchronous',
                default=True,
                help='If passed, use synchronous mode for sqlite'),
    cfg.IntOpt('sql_min_pool_size',
               default=1,
               help='Minimum number of SQL connections to keep open in a '
                     'pool'),
Exemplo n.º 16
0
from nova import db
from nova import exception
from nova.i18n import _, _LE
from nova.openstack.common import fileutils
from nova.openstack.common import log as logging
from nova import paths
from nova import utils


LOG = logging.getLogger(__name__)

crypto_opts = [
    cfg.StrOpt("ca_file", default="cacert.pem", help=_("Filename of root CA")),
    cfg.StrOpt("key_file", default=os.path.join("private", "cakey.pem"), help=_("Filename of private key")),
    cfg.StrOpt("crl_file", default="crl.pem", help=_("Filename of root Certificate Revocation List")),
    cfg.StrOpt("keys_path", default=paths.state_path_def("keys"), help=_("Where we keep our keys")),
    cfg.StrOpt("ca_path", default=paths.state_path_def("CA"), help=_("Where we keep our root CA")),
    cfg.BoolOpt("use_project_ca", default=False, help=_("Should we use a CA for each project?")),
    cfg.StrOpt(
        "user_cert_subject",
        default="/C=US/ST=California/O=OpenStack/" "OU=NovaDev/CN=%.16s-%.16s-%s",
        help=_("Subject for certificate for users, %s for " "project, user, timestamp"),
    ),
    cfg.StrOpt(
        "project_cert_subject",
        default="/C=US/ST=California/O=OpenStack/" "OU=NovaDev/CN=project-ca-%.16s-%s",
        help=_("Subject for certificate for projects, %s for " "project, timestamp"),
    ),
]

CONF = cfg.CONF
Exemplo n.º 17
0
import os
import os.path
import urllib

from oslo.config import cfg
import routes
import webob

from nova.openstack.common import fileutils
from nova import paths
from nova import utils
from nova import wsgi

s3_opts = [
    cfg.StrOpt('buckets_path',
               default=paths.state_path_def('buckets'),
               help='path to s3 buckets'),
    cfg.StrOpt('s3_listen',
               default="0.0.0.0",
               help='IP address for S3 API to listen'),
    cfg.IntOpt('s3_listen_port',
               default=3333,
               help='port for s3 api to listen'),
]

CONF = cfg.CONF
CONF.register_opts(s3_opts)


def get_wsgi_server():
    return wsgi.Server("S3 Objectstore",
Exemplo n.º 18
0
#    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.
"""Session Handling for SQLAlchemy backend."""

from oslo.config import cfg

from nova.openstack.common.db.sqlalchemy import session as nova_session
from nova import paths

opts = [
    cfg.StrOpt('sql_connection',
               default=('sqlite:///' +
                        paths.state_path_def('baremetal_$sqlite_db')),
               help='The SQLAlchemy connection string used to connect to the '
               'bare-metal database'),
]

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

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

CONF.import_opt('sqlite_db', 'nova.openstack.common.db.sqlalchemy.session')

_ENGINE = None
_MAKER = None
Exemplo n.º 19
0

LOG = logging.getLogger(__name__)

crypto_opts = [
    cfg.StrOpt('ca_file',
               default='cacert.pem',
               help=_('Filename of root CA')),
    cfg.StrOpt('key_file',
               default=os.path.join('private', 'cakey.pem'),
               help=_('Filename of private key')),
    cfg.StrOpt('crl_file',
               default='crl.pem',
               help=_('Filename of root Certificate Revocation List')),
    cfg.StrOpt('keys_path',
               default=paths.state_path_def('keys'),
               help=_('Where we keep our keys')),
    cfg.StrOpt('ca_path',
               default=paths.state_path_def('CA'),
               help=_('Where we keep our root CA')),
    cfg.BoolOpt('use_project_ca',
                default=False,
                help=_('Should we use a CA for each project?')),
    cfg.StrOpt('user_cert_subject',
               default='/C=US/ST=California/O=OpenStack/'
                       'OU=NovaDev/CN=%.16s-%.16s-%s',
               help=_('Subject for certificate for users, %s for '
                      'project, user, timestamp')),
    cfg.StrOpt('project_cert_subject',
               default='/C=US/ST=California/O=OpenStack/'
                       'OU=NovaDev/CN=project-ca-%.16s-%s',
Exemplo n.º 20
0
#    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.

"""Session Handling for SQLAlchemy backend."""

from oslo.config import cfg
from oslo.db.sqlalchemy import session as db_session

from nova import paths

opts = [
    cfg.StrOpt('sql_connection',
               default=('sqlite:///' +
                        paths.state_path_def('baremetal_nova.sqlite')),
               help='The SQLAlchemy connection string used to connect to the '
                    'bare-metal database'),
    ]

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

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


_FACADE = None

Exemplo n.º 21
0
from nova.openstack.common import log as logging
from nova.openstack.common import loopingcall
from nova import paths
from nova import utils
from nova.virt.baremetal import baremetal_states
from nova.virt.baremetal import base
from nova.virt.baremetal import utils as bm_utils

opts = [
    cfg.StrOpt('terminal',
               default='shellinaboxd',
               help='Path to baremetal terminal program'),
    cfg.StrOpt('terminal_cert_dir',
               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=10,
               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__)

Exemplo n.º 22
0
* Services that use this:

    ``nova-network``

* Related options:

    None
"""),
]

linux_net_opts = [
    cfg.MultiStrOpt('dhcpbridge_flagfile',
                    default=['/etc/nova/nova-dhcpbridge.conf'],
                    help='Location of flagfiles for dhcpbridge'),
    cfg.StrOpt('networks_path',
               default=paths.state_path_def('networks'),
               help='Location to keep network config files'),
    cfg.StrOpt('public_interface',
               default='eth0',
               help='Interface for public IP addresses'),
    cfg.StrOpt('dhcpbridge',
               default=paths.bindir_def('nova-dhcpbridge'),
               help='Location of nova-dhcpbridge'),
    cfg.StrOpt('routing_source_ip',
               default='$my_ip',
               help='Public IP of network host'),
    cfg.IntOpt('dhcp_lease_time',
               default=86400,
               help='Lifetime of a DHCP lease in seconds'),
    cfg.MultiStrOpt('dns_server',
                    default=[],
Exemplo n.º 23
0
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    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.

from oslo.config import cfg

from nova.openstack.common.db.sqlalchemy import session as db_session
from nova.openstack.common import rpc
from nova import paths

from gantt import version

_DEFAULT_SQL_CONNECTION = 'sqlite:///' + paths.state_path_def('$sqlite_db')


def parse_args(argv, default_config_files=None):
    db_session.set_defaults(sql_connection=_DEFAULT_SQL_CONNECTION,
                            sqlite_db='nova.sqlite')
    rpc.set_defaults(control_exchange='nova')
    cfg.CONF(argv[1:],
             project='gantt',
             version=version.version_string(),
             default_config_files=default_config_files)
Exemplo n.º 24
0
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    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.

from oslo.config import cfg

from nova.openstack.common.db.sqlalchemy import session as db_session
from nova import paths
from nova import rpc
from nova import version

_DEFAULT_SQL_CONNECTION = 'sqlite:///' + paths.state_path_def('$sqlite_db')


def parse_args(argv, default_config_files=None):
    db_session.set_defaults(sql_connection=_DEFAULT_SQL_CONNECTION,
                            sqlite_db='nova.sqlite')
    rpc.set_defaults(control_exchange='nova')
    cfg.CONF(argv[1:],
             project='nova',
             version=version.version_string(),
             default_config_files=default_config_files)
    rpc.init(cfg.CONF)
Exemplo n.º 25
0
#    License for the specific language governing permissions and limitations
#    under the License.

from oslo_config import cfg
from oslo_db import options
from oslo_log import log

from nova import debugger
from nova import paths
from nova import rpc
from nova import version


CONF = cfg.CONF

_DEFAULT_SQL_CONNECTION = 'sqlite:///' + paths.state_path_def('nova.sqlite')

# NOTE(mikal): suds is used by the vmware driver, removing this will
# cause many extraneous log lines for their tempest runs. Refer to
# https://review.openstack.org/#/c/219225/ for details.
_DEFAULT_LOG_LEVELS = ['amqp=WARN', 'amqplib=WARN', 'boto=WARN',
                       'qpid=WARN', 'sqlalchemy=WARN', 'suds=INFO',
                       'oslo_messaging=INFO', 'iso8601=WARN',
                       'requests.packages.urllib3.connectionpool=WARN',
                       'urllib3.connectionpool=WARN', 'websocket=WARN',
                       'keystonemiddleware=WARN', 'routes.middleware=WARN',
                       'stevedore=WARN', 'glanceclient=WARN']

_DEFAULT_LOGGING_CONTEXT_FORMAT = ('%(asctime)s.%(msecs)03d %(process)d '
                                   '%(levelname)s %(name)s [%(request_id)s '
                                   '%(user_identity)s] %(instance)s'
Exemplo n.º 26
0
            default=3,
            help='number of times to rescan iSCSI target to find volume',
            deprecated_group='DEFAULT'),
 cfg.IntOpt('num_iser_scan_tries',
            default=3,
            help='number of times to rescan iSER target to find volume',
            deprecated_group='DEFAULT'),
 cfg.StrOpt('rbd_user',
            help='the RADOS client name for accessing rbd volumes',
            deprecated_group='DEFAULT'),
 cfg.StrOpt('rbd_secret_uuid',
            help='the libvirt uuid of the secret for the rbd_user'
                 'volumes',
            deprecated_group='DEFAULT'),
 cfg.StrOpt('nfs_mount_point_base',
            default=paths.state_path_def('mnt'),
            help='Dir where the nfs volume is mounted on the compute node',
            deprecated_group='DEFAULT'),
 cfg.StrOpt('nfs_mount_options',
            help='Mount options passed to the nfs client. See section '
                 'of the nfs man page for details',
            deprecated_group='DEFAULT'),
 cfg.IntOpt('num_aoe_discover_tries',
            default=3,
            help='number of times to rediscover AoE target to find volume',
            deprecated_group='DEFAULT'),
 cfg.StrOpt('glusterfs_mount_point_base',
            default=paths.state_path_def('mnt'),
            help='Dir where the glusterfs volume is mounted on the '
                 'compute node',
            deprecated_group='DEFAULT'),
Exemplo n.º 27
0
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    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.

from oslo.config import cfg

from nova import debugger
from nova.openstack.common.db import options
from nova import paths
from nova import rpc
from nova import version

_DEFAULT_SQL_CONNECTION = "sqlite:///" + paths.state_path_def("nova.sqlite")


def parse_args(argv, default_config_files=None):
    options.set_defaults(sql_connection=_DEFAULT_SQL_CONNECTION, sqlite_db="nova.sqlite")
    rpc.set_defaults(control_exchange="nova")
    debugger.register_cli_opts()
    cfg.CONF(argv[1:], project="nova", version=version.version_string(), default_config_files=default_config_files)
    rpc.init(cfg.CONF)
Exemplo n.º 28
0
from nova.openstack.common import log as logging
from nova.openstack.common import loopingcall
from nova import paths
from nova import utils
from nova.virt.baremetal import baremetal_states
from nova.virt.baremetal import base
from nova.virt.baremetal import utils as bm_utils

opts = [
    cfg.StrOpt('terminal',
               default='shellinaboxd',
               help='Path to baremetal terminal program'),
    cfg.StrOpt('terminal_cert_dir',
               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=10,
               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__)
Exemplo n.º 29
0
#    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.

"""Session Handling for SQLAlchemy backend."""

from oslo.config import cfg

from nova.openstack.common.db.sqlalchemy import session as nova_session
from nova import paths

opts = [
    cfg.StrOpt('sql_connection',
               default=('sqlite:///' +
                        paths.state_path_def('baremetal_$sqlite_db')),
               help='The SQLAlchemy connection string used to connect to the '
                    'bare-metal database'),
    ]

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

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

CONF.import_opt('sqlite_db', 'nova.openstack.common.db.sqlalchemy.session')

_ENGINE = None
_MAKER = None
Exemplo n.º 30
0
import os.path
import urllib

from oslo.config import cfg
import routes
import webob

from nova.openstack.common import fileutils
from nova import paths
from nova import utils
from nova import wsgi


s3_opts = [
    cfg.StrOpt('buckets_path',
               default=paths.state_path_def('buckets'),
               help='path to s3 buckets'),
    cfg.StrOpt('s3_listen',
               default="0.0.0.0",
               help='IP address for S3 API to listen'),
    cfg.IntOpt('s3_listen_port',
               default=3333,
               help='port for s3 api to listen'),
]

CONF = cfg.CONF
CONF.register_opts(s3_opts)


def get_wsgi_server():
    return wsgi.Server("S3 Objectstore",
Exemplo n.º 31
0

LOG = logging.getLogger(__name__)

crypto_opts = [
    cfg.StrOpt('ca_file',
               default='cacert.pem',
               help=_('Filename of root CA')),
    cfg.StrOpt('key_file',
               default=os.path.join('private', 'cakey.pem'),
               help=_('Filename of private key')),
    cfg.StrOpt('crl_file',
               default='crl.pem',
               help=_('Filename of root Certificate Revocation List')),
    cfg.StrOpt('keys_path',
               default=paths.state_path_def('keys'),
               help=_('Where we keep our keys')),
    cfg.StrOpt('ca_path',
               default=paths.state_path_def('CA'),
               help=_('Where we keep our root CA')),
    cfg.BoolOpt('use_project_ca',
                default=False,
                help=_('Should we use a CA for each project?')),
    cfg.StrOpt('user_cert_subject',
               default='/C=US/ST=California/O=OpenStack/'
                       'OU=NovaDev/CN=%.16s-%.16s-%s',
               help=_('Subject for certificate for users, %s for '
                      'project, user, timestamp')),
    cfg.StrOpt('project_cert_subject',
               default='/C=US/ST=California/O=OpenStack/'
                       'OU=NovaDev/CN=project-ca-%.16s-%s',
Exemplo n.º 32
0
import subprocess
import signal
import commands
from nova.network import linux_net
from nova import paths
from nova import utils
import novaclient.v1_1.client as nvclient
from oslo.config import cfg
import re

linux_net_opts = [
    cfg.MultiStrOpt('dhcpbridge_flagfile',
                    default=['/etc/nova/nova-dhcpbridge.conf'],
                    help='location of flagfiles for dhcpbridge'),
    cfg.StrOpt('networks_path',
               default=paths.state_path_def('networks'),
               help='Location to keep network config files'),
    cfg.StrOpt('public_interface',
               default='eth0',
               help='Interface for public IP addresses'),
    cfg.StrOpt('network_device_mtu',
               default=None,
               help='MTU setting for vlan'),
    cfg.StrOpt('dhcpbridge',
               default=paths.bindir_def('nova-dhcpbridge'),
               help='location of nova-dhcpbridge'),
    cfg.StrOpt('routing_source_ip',
               default='$my_ip',
               help='Public IP of network host'),
    cfg.IntOpt('dhcp_lease_time',
               default=120,
Exemplo n.º 33
0
#    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.
"""Session Handling for SQLAlchemy backend."""

from oslo.config import cfg

from nova.openstack.common.db.sqlalchemy import session as db_session
from nova import paths

opts = [
    cfg.StrOpt('sql_connection',
               default=('sqlite:///' +
                        paths.state_path_def('baremetal_nova.sqlite')),
               help='The SQLAlchemy connection string used to connect to the '
               'bare-metal database'),
]

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

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

_FACADE = None


def _create_facade_lazily():
    global _FACADE
Exemplo n.º 34
0
import os.path
import urllib

from oslo.config import cfg
import routes
import six
import webob

from nova.openstack.common import fileutils
from nova import paths
from nova import utils
from nova import wsgi


s3_opts = [
    cfg.StrOpt("buckets_path", default=paths.state_path_def("buckets"), help="Path to S3 buckets"),
    cfg.StrOpt("s3_listen", default="0.0.0.0", help="IP address for S3 API to listen"),
    cfg.IntOpt("s3_listen_port", default=3333, help="Port for S3 API to listen"),
]

CONF = cfg.CONF
CONF.register_opts(s3_opts)


def get_wsgi_server():
    return wsgi.Server(
        "S3 Objectstore", S3Application(CONF.buckets_path), port=CONF.s3_listen_port, host=CONF.s3_listen
    )


class S3Application(wsgi.Router):
Exemplo n.º 35
0
Arquivo: nfs.py Projeto: isyippee/nova
from oslo_concurrency import processutils
from oslo_config import cfg
from oslo_log import log as logging

from nova.i18n import _LE, _LW
from nova import paths
from nova import utils
from nova.virt.libvirt import utils as libvirt_utils
from nova.virt.libvirt.volume import fs

LOG = logging.getLogger(__name__)

volume_opts = [
    cfg.StrOpt(
        "nfs_mount_point_base",
        default=paths.state_path_def("mnt"),
        help="Directory where the NFS volume is mounted on the" " compute node",
    ),
    cfg.StrOpt(
        "nfs_mount_options",
        help="Mount options passed to the NFS client. See section " "of the nfs man page for details",
    ),
]

CONF = cfg.CONF
CONF.register_opts(volume_opts, "libvirt")


class LibvirtNFSVolumeDriver(fs.LibvirtBaseFileSystemVolumeDriver):
    """Class implements libvirt part of volume driver for NFS."""
Exemplo n.º 36
0
from nova.virt.libvirt import config as vconfig
from nova.virt.libvirt import utils as virtutils

LOG = logging.getLogger(__name__)

volume_opts = [
    cfg.IntOpt('num_iscsi_scan_tries',
               default=3,
               help='number of times to rescan iSCSI target to find volume'),
    cfg.StrOpt('rbd_user',
               help='the RADOS client name for accessing rbd volumes'),
    cfg.StrOpt('rbd_secret_uuid',
               help='the libvirt uuid of the secret for the rbd_user'
               'volumes'),
    cfg.StrOpt('nfs_mount_point_base',
               default=paths.state_path_def('mnt'),
               help='Dir where the nfs volume is mounted on the compute node'),
    cfg.StrOpt('nfs_mount_options',
               help='Mount options passed to the nfs client. See section '
               'of the nfs man page for details'),
    cfg.IntOpt('num_aoe_discover_tries',
               default=3,
               help='number of times to rediscover AoE target to find volume'),
    cfg.StrOpt('glusterfs_mount_point_base',
               default=paths.state_path_def('mnt'),
               help='Dir where the glusterfs volume is mounted on the '
               'compute node'),
    cfg.BoolOpt('libvirt_iscsi_use_multipath',
                default=False,
                help='use multipath connection of the iSCSI volume'),
    cfg.StrOpt('scality_sofs_config',
Exemplo n.º 37
0
    MySQLdb = None
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

import nova.exception
from nova.openstack.common import cfg
import nova.openstack.common.log as logging
from nova.openstack.common import timeutils
from nova import paths

sql_opts = [
    cfg.StrOpt('sql_connection',
               default='sqlite:///' + paths.state_path_def('$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,
               help='timeout before idle sql connections are reaped'),
    cfg.BoolOpt('sqlite_synchronous',
                default=True,
                help='If passed, use synchronous mode for sqlite'),
    cfg.IntOpt('sql_min_pool_size',
               default=1,
               help='Minimum number of SQL connections to keep open in a '
               'pool'),