summaryrefslogtreecommitdiffstats
path: root/onap_data_provider/resources/vnf_resource.py
diff options
context:
space:
mode:
authorMichal Jagiello <michal.jagiello@t-mobile.pl>2022-01-27 08:31:36 +0000
committerMichal Jagiello <michal.jagiello@t-mobile.pl>2022-01-27 08:31:36 +0000
commitb1112188466a5712cd41f1a88b5f4bcf31949d15 (patch)
tree6ad033eb9c9ceb6a768d3a8082bcb8f36dec8b9a /onap_data_provider/resources/vnf_resource.py
parent4ffd0d95b7a875372447d6193a978bd451adb7ae (diff)
Add xNFs category and subcategory
Issue-ID: INT-2054 Signed-off-by: Michal Jagiello <michal.jagiello@t-mobile.pl> Change-Id: Iae6e95e882570740d7fe761ad673511a346c9c57
Diffstat (limited to 'onap_data_provider/resources/vnf_resource.py')
-rw-r--r--onap_data_provider/resources/vnf_resource.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/onap_data_provider/resources/vnf_resource.py b/onap_data_provider/resources/vnf_resource.py
index 1d47413..9c77f19 100644
--- a/onap_data_provider/resources/vnf_resource.py
+++ b/onap_data_provider/resources/vnf_resource.py
@@ -18,6 +18,7 @@
import logging
from typing import Any, Dict
+from onapsdk.sdc.vendor import Vendor # type: ignore
from onapsdk.sdc.vf import Vf # type: ignore
from .resource import Resource
from .xnf_resource import XnfResource
@@ -46,7 +47,9 @@ class VnfResource(Resource, XnfResource):
"""
if not self.exists:
logging.debug("Create Vnf %s", self.data["name"])
- self._xnf = Vf(name=self.data["name"])
+ self._xnf = Vf(name=self.data["name"], category=self.data.get("category"), subcategory=self.data.get("subcategory"))
+ if (vendor_name := self.data.get("vendor")) is not None:
+ self._xnf._vendor = Vendor(vendor_name)
self.onboard_resource_with_properties(self.data)
@property