Merge "Unify the driver config opts"
This commit is contained in:
commit
281312fae4
@ -387,18 +387,13 @@ auth_uri = http://127.0.0.1:5000
|
|||||||
|
|
||||||
[tacker]
|
[tacker]
|
||||||
# Specify drivers for hosting device
|
# Specify drivers for hosting device
|
||||||
# exmpale: infra_driver = noop
|
# infra_driver = heat,nova,noop
|
||||||
# exmpale: infra_driver = nova
|
|
||||||
# exmpale: infra_driver = heat
|
|
||||||
infra_driver = heat
|
|
||||||
|
|
||||||
# Specify drivers for mgmt
|
# Specify drivers for mgmt
|
||||||
mgmt_driver = noop
|
# mgmt_driver = noop,openwrt
|
||||||
mgmt_driver = openwrt
|
|
||||||
|
|
||||||
# Specify drivers for monitoring
|
# Specify drivers for monitoring
|
||||||
monitor_driver = ping
|
# monitor_driver = ping, http_ping
|
||||||
monitor_driver = http_ping
|
|
||||||
|
|
||||||
[tacker_nova]
|
[tacker_nova]
|
||||||
# parameters for novaclient to talk to nova
|
# parameters for novaclient to talk to nova
|
||||||
|
@ -46,9 +46,9 @@ tacker.service_plugins =
|
|||||||
tacker.openstack.common.cache.backends =
|
tacker.openstack.common.cache.backends =
|
||||||
memory = tacker.openstack.common.cache._backends.memory:MemoryBackend
|
memory = tacker.openstack.common.cache._backends.memory:MemoryBackend
|
||||||
tacker.tacker.device.drivers =
|
tacker.tacker.device.drivers =
|
||||||
noop = tacker.vm.drivers.noop:DeviceNoop
|
noop = tacker.vm.infra_drivers.noop:DeviceNoop
|
||||||
nova = tacker.vm.drivers.nova.nova:DeviceNova
|
nova = tacker.vm.infra_drivers.nova.nova:DeviceNova
|
||||||
heat = tacker.vm.drivers.heat.heat:DeviceHeat
|
heat = tacker.vm.infra_drivers.heat.heat:DeviceHeat
|
||||||
tacker.tacker.mgmt.drivers =
|
tacker.tacker.mgmt.drivers =
|
||||||
noop = tacker.vm.mgmt_drivers.noop:DeviceMgmtNoop
|
noop = tacker.vm.mgmt_drivers.noop:DeviceMgmtNoop
|
||||||
openwrt = tacker.vm.mgmt_drivers.openwrt.openwrt:DeviceMgmtOpenWRT
|
openwrt = tacker.vm.mgmt_drivers.openwrt.openwrt:DeviceMgmtOpenWRT
|
||||||
|
@ -18,7 +18,7 @@ import testtools
|
|||||||
|
|
||||||
from tacker import context
|
from tacker import context
|
||||||
from tacker.tests.unit.db import utils
|
from tacker.tests.unit.db import utils
|
||||||
from tacker.vm.drivers.heat import heat
|
from tacker.vm.infra_drivers.heat import heat
|
||||||
|
|
||||||
|
|
||||||
class FakeHeatClient(mock.Mock):
|
class FakeHeatClient(mock.Mock):
|
||||||
@ -48,15 +48,16 @@ class TestDeviceHeat(testtools.TestCase):
|
|||||||
fake_heat_client = mock.Mock()
|
fake_heat_client = mock.Mock()
|
||||||
fake_heat_client.return_value = self.heat_client
|
fake_heat_client.return_value = self.heat_client
|
||||||
self._mock(
|
self._mock(
|
||||||
'tacker.vm.drivers.heat.heat.HeatClient', fake_heat_client)
|
'tacker.vm.infra_drivers.heat.heat.HeatClient', fake_heat_client)
|
||||||
|
|
||||||
def _mock(self, target, new=mock.DEFAULT):
|
def _mock(self, target, new=mock.DEFAULT):
|
||||||
patcher = mock.patch(target, new)
|
patcher = mock.patch(target, new)
|
||||||
return patcher.start()
|
return patcher.start()
|
||||||
|
|
||||||
def _get_expected_fields(self):
|
def _get_expected_fields(self):
|
||||||
return {'stack_name': 'tacker.vm.drivers.heat.heat_DeviceHeat-eb84260e'
|
return {'stack_name':
|
||||||
'-5ff7-4332-b032-50a14d6c1123', 'template':
|
'tacker.vm.infra_drivers.heat.heat_DeviceHeat-eb84260e'
|
||||||
|
'-5ff7-4332-b032-50a14d6c1123', 'template':
|
||||||
'description: OpenWRT with services\nheat_template_version: '
|
'description: OpenWRT with services\nheat_template_version: '
|
||||||
'2013-05-23\noutputs:\n mgmt_ip-vdu1:\n description: '
|
'2013-05-23\noutputs:\n mgmt_ip-vdu1:\n description: '
|
||||||
'management ip address\n value:\n get_attr: [vdu1-net_mgmt'
|
'management ip address\n value:\n get_attr: [vdu1-net_mgmt'
|
||||||
@ -71,8 +72,9 @@ class TestDeviceHeat(testtools.TestCase):
|
|||||||
' type: OS::Neutron::Port\n'}
|
' type: OS::Neutron::Port\n'}
|
||||||
|
|
||||||
def _get_expected_fields_user_data(self):
|
def _get_expected_fields_user_data(self):
|
||||||
return {'stack_name': 'tacker.vm.drivers.heat.heat_DeviceHeat-18685f68'
|
return {'stack_name':
|
||||||
'-2b2a-4185-8566-74f54e548811', 'template':
|
'tacker.vm.infra_drivers.heat.heat_DeviceHeat-18685f68'
|
||||||
|
'-2b2a-4185-8566-74f54e548811', 'template':
|
||||||
'description: Parameterized VNF descriptor\nheat_template_version:'
|
'description: Parameterized VNF descriptor\nheat_template_version:'
|
||||||
' 2013-05-23\noutputs:\n mgmt_ip-vdu1:\n description: '
|
' 2013-05-23\noutputs:\n mgmt_ip-vdu1:\n description: '
|
||||||
'management ip address\n value:\n get_attr: '
|
'management ip address\n value:\n get_attr: '
|
||||||
@ -91,8 +93,9 @@ class TestDeviceHeat(testtools.TestCase):
|
|||||||
'type: OS::Neutron::Port\n'}
|
'type: OS::Neutron::Port\n'}
|
||||||
|
|
||||||
def _get_expected_fields_ipaddr_data(self):
|
def _get_expected_fields_ipaddr_data(self):
|
||||||
return {'stack_name': 'tacker.vm.drivers.heat.heat_DeviceHeat-d1337add'
|
return {'stack_name':
|
||||||
'-d5a1-4fd4-9447-bb9243c8460b', 'template':
|
'tacker.vm.infra_drivers.heat.heat_DeviceHeat-d1337add'
|
||||||
|
'-d5a1-4fd4-9447-bb9243c8460b', 'template':
|
||||||
'description: Parameterized VNF descriptor for IP addresses\n'
|
'description: Parameterized VNF descriptor for IP addresses\n'
|
||||||
'heat_template_version: 2013-05-23\noutputs:\n mgmt_ip-vdu1:\n '
|
'heat_template_version: 2013-05-23\noutputs:\n mgmt_ip-vdu1:\n '
|
||||||
' description: management ip address\n value:\n '
|
' description: management ip address\n value:\n '
|
||||||
|
@ -29,7 +29,7 @@ from tacker.common import log
|
|||||||
from tacker.extensions import vnfm
|
from tacker.extensions import vnfm
|
||||||
from tacker.openstack.common import jsonutils
|
from tacker.openstack.common import jsonutils
|
||||||
from tacker.openstack.common import log as logging
|
from tacker.openstack.common import log as logging
|
||||||
from tacker.vm.drivers import abstract_driver
|
from tacker.vm.infra_drivers import abstract_driver
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
@ -23,7 +23,7 @@ import uuid
|
|||||||
|
|
||||||
from tacker.common import log
|
from tacker.common import log
|
||||||
from tacker.openstack.common import log as logging
|
from tacker.openstack.common import log as logging
|
||||||
from tacker.vm.drivers import abstract_driver
|
from tacker.vm.infra_drivers import abstract_driver
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
@ -28,7 +28,7 @@ from oslo_config import cfg
|
|||||||
from tacker.api.v1 import attributes
|
from tacker.api.v1 import attributes
|
||||||
from tacker.i18n import _LE, _LW
|
from tacker.i18n import _LE, _LW
|
||||||
from tacker.openstack.common import log as logging
|
from tacker.openstack.common import log as logging
|
||||||
from tacker.vm.drivers import abstract_driver
|
from tacker.vm.infra_drivers import abstract_driver
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
@ -30,7 +30,7 @@ from tacker.common import driver_manager
|
|||||||
from tacker import context as t_context
|
from tacker import context as t_context
|
||||||
from tacker.openstack.common import jsonutils
|
from tacker.openstack.common import jsonutils
|
||||||
from tacker.openstack.common import log as logging
|
from tacker.openstack.common import log as logging
|
||||||
from tacker.vm.drivers.heat import heat
|
from tacker.vm.infra_drivers.heat import heat
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
@ -52,8 +52,8 @@ class VNFMonitor(object):
|
|||||||
_lock = threading.RLock()
|
_lock = threading.RLock()
|
||||||
|
|
||||||
OPTS = [
|
OPTS = [
|
||||||
cfg.MultiStrOpt(
|
cfg.ListOpt(
|
||||||
'monitor_driver', default=[],
|
'monitor_driver', default=['ping', 'http_ping'],
|
||||||
help=_('Monitor driver to communicate with '
|
help=_('Monitor driver to communicate with '
|
||||||
'Hosting VNF/logical service '
|
'Hosting VNF/logical service '
|
||||||
'instance tacker plugin will use')),
|
'instance tacker plugin will use')),
|
||||||
|
@ -41,8 +41,8 @@ LOG = logging.getLogger(__name__)
|
|||||||
|
|
||||||
class VNFMMgmtMixin(object):
|
class VNFMMgmtMixin(object):
|
||||||
OPTS = [
|
OPTS = [
|
||||||
cfg.MultiStrOpt(
|
cfg.ListOpt(
|
||||||
'mgmt_driver', default=[],
|
'mgmt_driver', default=['noop', 'openwrt'],
|
||||||
help=_('MGMT driver to communicate with '
|
help=_('MGMT driver to communicate with '
|
||||||
'Hosting Device/logical service '
|
'Hosting Device/logical service '
|
||||||
'instance tacker plugin will use')),
|
'instance tacker plugin will use')),
|
||||||
@ -106,7 +106,7 @@ class VNFMPlugin(vm_db.VNFMPluginDb, VNFMMgmtMixin):
|
|||||||
"""
|
"""
|
||||||
OPTS = [
|
OPTS = [
|
||||||
cfg.ListOpt(
|
cfg.ListOpt(
|
||||||
'infra_driver', default=['heat'],
|
'infra_driver', default=['nova', 'heat', 'noop'],
|
||||||
help=_('Hosting device drivers tacker plugin will use')),
|
help=_('Hosting device drivers tacker plugin will use')),
|
||||||
]
|
]
|
||||||
cfg.CONF.register_opts(OPTS, 'tacker')
|
cfg.CONF.register_opts(OPTS, 'tacker')
|
||||||
|
Loading…
Reference in New Issue
Block a user