Merge "Deprecate warning for infra_driver and mgmt_driver at server"

This commit is contained in:
Jenkins
2016-09-07 09:30:19 +00:00
committed by Gerrit Code Review
2 changed files with 12 additions and 0 deletions

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()