From 6f2c152434bf1d6c4ba05cc7eb3df9cc77fe2af2 Mon Sep 17 00:00:00 2001 From: Manikantha Srinivas Tadi Date: Tue, 20 Sep 2016 06:42:00 -0400 Subject: [PATCH] Modified the VNFD Resource state to OnBoarded Currently, in Horizon and CLI, the display for the the VNFD state is set to "Not Applicable".Modified to display "OnBoarded" once the VNFD is created.. Change-Id: I1a67638b488895378b16662625cab0f8bca90e53 Closes-Bug: #1623067 --- tacker/db/vnfm/vnfm_db.py | 2 +- tacker/plugins/common/constants.py | 1 + tacker/tests/unit/vm/test_plugin.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tacker/db/vnfm/vnfm_db.py b/tacker/db/vnfm/vnfm_db.py index b2e7aa64f..6ca2041eb 100644 --- a/tacker/db/vnfm/vnfm_db.py +++ b/tacker/db/vnfm/vnfm_db.py @@ -265,7 +265,7 @@ class VNFMPluginDb(vnfm.VNFMPluginBase, db_base.CommonDbMixin): self._cos_db_plg.create_event( context, res_id=vnfd_dict['id'], res_type=constants.RES_TYPE_VNFD, - res_state=constants.RES_EVT_VNFD_NA_STATE, + res_state=constants.RES_EVT_VNFD_ONBOARDED, evt_type=constants.RES_EVT_CREATE, tstamp=vnfd_dict[constants.RES_EVT_CREATED_FLD]) return vnfd_dict diff --git a/tacker/plugins/common/constants.py b/tacker/plugins/common/constants.py index e65d4a6fd..b590eb4ae 100644 --- a/tacker/plugins/common/constants.py +++ b/tacker/plugins/common/constants.py @@ -65,6 +65,7 @@ RES_EVT_UPDATE = "UPDATE" RES_EVT_MONITOR = "MONITOR" RES_EVT_SCALE = "SCALE" RES_EVT_VNFD_NA_STATE = "Not Applicable" +RES_EVT_VNFD_ONBOARDED = "OnBoarded" RES_EVT_CREATED_FLD = "created_at" RES_EVT_DELETED_FLD = "deleted_at" diff --git a/tacker/tests/unit/vm/test_plugin.py b/tacker/tests/unit/vm/test_plugin.py index 5d2da2c20..4bddd3aed 100644 --- a/tacker/tests/unit/vm/test_plugin.py +++ b/tacker/tests/unit/vm/test_plugin.py @@ -228,7 +228,7 @@ class TestVNFMPlugin(db_base.SqlTestCase): mock_update_imports.assert_called_once_with(yaml_dict) self._cos_db_plugin.create_event.assert_called_once_with( self.context, evt_type=constants.RES_EVT_CREATE, res_id=mock.ANY, - res_state=constants.RES_EVT_VNFD_NA_STATE, + res_state=constants.RES_EVT_VNFD_ONBOARDED, res_type=constants.RES_TYPE_VNFD, tstamp=mock.ANY) def test_create_vnfd_no_service_types(self):