Device refactor part4: rename vm plugin and db into vnfm plugin and db

Change-Id: Iee231428b7f30c4710b264e73ba71b5d5a4f84bb
Partial-bug: #1589018
This commit is contained in:
gong yong sheng 2016-08-31 09:57:22 +08:00
parent 3f4e899f79
commit cc1e82aa84
10 changed files with 20 additions and 20 deletions

View File

@ -22,16 +22,16 @@ How to write a new monitor driver
A monitor driver for tacker is a python module which contains a class that
inherits from
"tacker.vm.monitor_drivers.abstract_driver.VNFMonitorAbstractDriver". If the
"tacker.vnfm.monitor_drivers.abstract_driver.VNFMonitorAbstractDriver". If the
driver depends/imports more than one module, then create a new python package
under tacker/vm/monitor_drivers folder. After this we have to mention our
under tacker/vnfm/monitor_drivers folder. After this we have to mention our
driver path in setup.cfg file in root directory.
For example:
::
tacker.tacker.monitor_drivers =
ping = tacker.vm.monitor_drivers.ping.ping:VNFMonitorPing
ping = tacker.vnfm.monitor_drivers.ping.ping:VNFMonitorPing
Following methods need to be overridden in the new driver:

View File

@ -65,7 +65,7 @@ network function.
flavor describing physical properties for the VDU to be spawned, monitoring
policies for the VDU, providing user data in form of custom commands to the
VDU. A complete list of VDU properties currently supported by Tacker are
listed `here <https://github.com/openstack/tacker/blob/master/tacker/vm/
listed `here <https://github.com/openstack/tacker/blob/master/tacker/vnfm/
tosca/lib/tacker_nfv_defs.yaml>`_ under **properties** section of
**tosca.nodes.nfv.VDU.Tacker** field

View File

@ -40,14 +40,14 @@ console_scripts =
tacker-rootwrap = oslo.rootwrap.cmd:main
tacker.service_plugins =
dummy = tacker.tests.unit.dummy_plugin:DummyServicePlugin
vnfm = tacker.vm.plugin:VNFMPlugin
vnfm = tacker.vnfm.plugin:VNFMPlugin
nfvo = tacker.nfvo.nfvo_plugin:NfvoPlugin
commonservices = tacker.plugins.common_services.common_services_plugin:CommonServicesPlugin
tacker.nfvo.vim.drivers =
openstack = tacker.nfvo.drivers.vim.openstack_driver:OpenStack_Driver
tacker.openstack.common.cache.backends =
memory = tacker.openstack.common.cache._backends.memory:MemoryBackend
tacker.tacker.device.drivers =
tacker.tacker.vnfm.drivers =
noop = tacker.vnfm.infra_drivers.noop:DeviceNoop
nova = tacker.vnfm.infra_drivers.nova.nova:DeviceNova
heat = tacker.vnfm.infra_drivers.heat.heat:DeviceHeat
@ -65,7 +65,7 @@ oslo.config.opts =
tacker.nfvo.nfvo_plugin = tacker.nfvo.nfvo_plugin:config_opts
tacker.nfvo.drivers.vim.openstack_driver = tacker.nfvo.drivers.vim.openstack_driver:config_opts
tacker.vnfm.monitor = tacker.vnfm.monitor:config_opts
tacker.vnfm.plugin = tacker.vm.plugin:config_opts
tacker.vnfm.plugin = tacker.vnfm.plugin:config_opts
tacker.vnfm.vim_client = tacker.vnfm.vim_client:config_opts
tacker.vnfm.infra_drivers.heat.heat= tacker.vnfm.infra_drivers.heat.heat:config_opts
tacker.vnfm.infra_drivers.openstack.openstack= tacker.vnfm.infra_drivers.openstack.openstack:config_opts

View File

@ -24,7 +24,7 @@ Based on this comparison database can be healed with healing migration.
from tacker.db import model_base
from tacker.db.nfvo import nfvo_db # noqa
from tacker.db.nfvo import vnffg_db # noqa
from tacker.db.vm import vm_db # noqa
from tacker.db.vnfm import vnfm_db # noqa
def get_metadata():

View File

@ -28,7 +28,7 @@ from tacker.db import db_base
from tacker.db import model_base
from tacker.db import models_v1
from tacker.db import types
from tacker.db.vm import vm_db
from tacker.db.vnfm import vnfm_db
from tacker.extensions import nfvo
from tacker import manager
from tacker.plugins.common import constants
@ -167,7 +167,7 @@ class NfvoPluginDb(nfvo.NFVOPluginBase, db_base.CommonDbMixin):
def is_vim_still_in_use(self, context, vim_id):
with context.session.begin(subtransactions=True):
vnfs_db = self._model_query(context, vm_db.VNF).filter_by(
vnfs_db = self._model_query(context, vnfm_db.VNF).filter_by(
vim_id=vim_id).first()
if vnfs_db is not None:
raise nfvo.VimInUseException(vim_id=vim_id)

View File

@ -21,12 +21,12 @@ import yaml
from tacker import context
from tacker.db.common_services import common_services_db
from tacker.db.nfvo import nfvo_db
from tacker.db.vm import vm_db
from tacker.db.vnfm import vnfm_db
from tacker.extensions import vnfm
from tacker.plugins.common import constants
from tacker.tests.unit.db import base as db_base
from tacker.tests.unit.db import utils
from tacker.vm import plugin
from tacker.vnfm import plugin
class FakeDriverManager(mock.Mock):
@ -108,7 +108,7 @@ class TestVNFMPlugin(db_base.SqlTestCase):
def _insert_dummy_device_template(self):
session = self.context.session
device_template = vm_db.VNFD(
device_template = vnfm_db.VNFD(
id='eb094833-995e-49f0-a047-dfb56aaf7c4e',
tenant_id='ad7ebc56538745a08ef7c5e97f8bd437',
name='fake_template',
@ -121,7 +121,7 @@ class TestVNFMPlugin(db_base.SqlTestCase):
def _insert_dummy_device(self):
session = self.context.session
device_db = vm_db.VNF(
device_db = vnfm_db.VNF(
id='6261579e-d6f3-49ad-8bc3-a9cb974778ff',
tenant_id='ad7ebc56538745a08ef7c5e97f8bd437',
name='fake_device',
@ -156,9 +156,9 @@ class TestVNFMPlugin(db_base.SqlTestCase):
session.add(vim_auth_db)
session.flush()
@mock.patch('tacker.vm.plugin.toscautils.updateimports')
@mock.patch('tacker.vm.plugin.ToscaTemplate')
@mock.patch('tacker.vm.plugin.toscautils.get_mgmt_driver')
@mock.patch('tacker.vnfm.plugin.toscautils.updateimports')
@mock.patch('tacker.vnfm.plugin.ToscaTemplate')
@mock.patch('tacker.vnfm.plugin.toscautils.get_mgmt_driver')
def test_create_vnfd(self, mock_get_mgmt_driver, mock_tosca_template,
mock_update_imports):
mock_get_mgmt_driver.return_value = 'dummy_mgmt_driver'

View File

View File

@ -30,7 +30,7 @@ from tacker.api.v1 import attributes
from tacker.common import driver_manager
from tacker.common import exceptions
from tacker.common import utils
from tacker.db.vm import vm_db
from tacker.db.vnfm import vnfm_db
from tacker.extensions import vnfm
from tacker.plugins.common import constants
from tacker.vnfm.mgmt_drivers import constants as mgmt_constants
@ -107,7 +107,7 @@ class VNFMMgmtMixin(object):
kwargs=kwargs)
class VNFMPlugin(vm_db.VNFMPluginDb, VNFMMgmtMixin):
class VNFMPlugin(vnfm_db.VNFMPluginDb, VNFMMgmtMixin):
"""VNFMPlugin which supports VNFM framework.
Plugin which supports Tacker framework
@ -126,7 +126,7 @@ class VNFMPlugin(vm_db.VNFMPluginDb, VNFMMgmtMixin):
self.boot_wait = cfg.CONF.tacker.boot_wait
self.vim_client = vim_client.VimClient()
self._vnf_manager = driver_manager.DriverManager(
'tacker.tacker.device.drivers',
'tacker.tacker.vnfm.drivers',
cfg.CONF.tacker.infra_driver)
self._vnf_monitor = monitor.VNFMonitor(self.boot_wait)