Deprecate warning for infra_driver and mgmt_driver at server

Deprecation warning deriving infra and mgmt driver from VNFD create API is
added.

Change-Id: Ieb2ff2a21fa6387ea38734ae65b0bddddd35f2a7
Partial-bug: #1618724
This commit is contained in:
Janki 2016-08-31 07:20:49 +05:30
parent c352162639
commit 99f58e4f5f
2 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,4 @@
---
deprecations:
- Deriving infra_driver and mgmt_drvier from VNFD API is deprecated and will
be removed in Ocata.

View File

@ -17,6 +17,7 @@
import uuid
from oslo_log import log as logging
from oslo_log import versionutils
from oslo_utils import timeutils
import sqlalchemy as sa
@ -229,6 +230,13 @@ class VNFMPluginDb(vnfm.VNFMPluginBase, db_base.CommonDbMixin):
mgmt_driver = vnfd.get('mgmt_driver')
service_types = vnfd.get('service_types')
if 'infra_driver' in vnfd or 'mgmt_driver' in vnfd:
versionutils.report_deprecated_feature(LOG, "Deriving "
"infra_driver and mgmt_driver from VNFD API is deprecated and"
" will be removed in Ocata. infra_driver will be automatically"
" derived from target vim type. mgmt_driver will be derived "
"from TOSCA template values.")
if (not attributes.is_attr_set(infra_driver)):
LOG.debug(_('hosting vnf driver unspecified'))
raise vnfm.InfraDriverNotSpecified()