diff --git a/doc/source/devref/monitor-api.rst b/doc/source/devref/monitor-api.rst index 2f0915f75..fc9fabb1b 100644 --- a/doc/source/devref/monitor-api.rst +++ b/doc/source/devref/monitor-api.rst @@ -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: diff --git a/doc/source/devref/vnfd_template_description.rst b/doc/source/devref/vnfd_template_description.rst index d11d051ea..3b583b915 100644 --- a/doc/source/devref/vnfd_template_description.rst +++ b/doc/source/devref/vnfd_template_description.rst @@ -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 `_ under **properties** section of **tosca.nodes.nfv.VDU.Tacker** field diff --git a/setup.cfg b/setup.cfg index e88776c1e..3def35adf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 diff --git a/tacker/db/migration/models/head.py b/tacker/db/migration/models/head.py index efa163e2c..27f4e1fd6 100644 --- a/tacker/db/migration/models/head.py +++ b/tacker/db/migration/models/head.py @@ -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(): diff --git a/tacker/db/nfvo/nfvo_db.py b/tacker/db/nfvo/nfvo_db.py index 246ebd75e..ceeccb765 100644 --- a/tacker/db/nfvo/nfvo_db.py +++ b/tacker/db/nfvo/nfvo_db.py @@ -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) diff --git a/tacker/db/vm/__init__.py b/tacker/db/vnfm/__init__.py similarity index 100% rename from tacker/db/vm/__init__.py rename to tacker/db/vnfm/__init__.py diff --git a/tacker/db/vm/vm_db.py b/tacker/db/vnfm/vnfm_db.py similarity index 100% rename from tacker/db/vm/vm_db.py rename to tacker/db/vnfm/vnfm_db.py diff --git a/tacker/tests/unit/vm/test_plugin.py b/tacker/tests/unit/vm/test_plugin.py index b4e90951c..64c7ed7f6 100644 --- a/tacker/tests/unit/vm/test_plugin.py +++ b/tacker/tests/unit/vm/test_plugin.py @@ -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' diff --git a/tacker/vm/__init__.py b/tacker/vm/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tacker/vm/plugin.py b/tacker/vnfm/plugin.py similarity index 99% rename from tacker/vm/plugin.py rename to tacker/vnfm/plugin.py index c5558e8cb..19a5809fa 100644 --- a/tacker/vm/plugin.py +++ b/tacker/vnfm/plugin.py @@ -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)