from osm_lcm.frontend_grpc import FrontendExecutorStub
from osm_lcm.lcm_utils import LcmBase
+from osm_lcm.data_utils.database.database import Database
+from osm_lcm.data_utils.filesystem.filesystem import Filesystem
+
from n2vc.n2vc_conn import N2VCConnector
from n2vc.k8s_helm_conn import K8sHelmConnector
from n2vc.k8s_helm3_conn import K8sHelm3Connector
_MAX_RETRY_TIME = 30
def __init__(self,
- db: object,
- fs: object,
log: object = None,
loop: object = None,
url: str = None,
Initialize EE helm connector.
"""
+ self.db = Database().instance.db
+ self.fs = Filesystem().instance.fs
+
# parent class constructor
N2VCConnector.__init__(
self,
- db=db,
- fs=fs,
log=log,
loop=loop,
url=url,
username=username,
vca_config=vca_config,
on_update_db=on_update_db,
+ db=self.db,
+ fs=self.fs
)
self.log.debug("Initialize helm N2VC connector")
kubectl_command=self.vca_config.get("kubectlpath"),
helm_command=self.vca_config.get("helmpath"),
fs=self.fs,
- log=self.log,
db=self.db,
+ log=self.log,
on_update_db=None,
)
else:
full_path = self.fs.path + "/" + helm_chart_path
+ while full_path.find("//") >= 0:
+ full_path = full_path.replace("//", "/")
+
try:
# Call helm conn install
# Obtain system cluster id from database
# Uninstall chart, for backward compatibility we must assume that if there is no
# version it is helm-v2
if version == "helm-v3":
- await self._k8sclusterhelm3.uninstall(system_cluster_uuid, helm_id)
+ await self._k8sclusterhelm3.uninstall(system_cluster_uuid, helm_id)
else:
await self._k8sclusterhelm2.uninstall(system_cluster_uuid, helm_id)
self.log.info("ee_id: {} deleted".format(ee_id))
@retryer(max_wait_time=_MAX_RETRY_TIME, delay_time=_EE_RETRY_DELAY)
async def _execute_primitive(self, ip_addr, primitive_name, params, db_dict=None):
- return await self._execute_primitive_internal(ip_addr, primitive_name, params, db_dict=db_dict)
+ return await self._execute_primitive_internal(ip_addr, primitive_name, params, db_dict=db_dict)
async def _execute_primitive_internal(self, ip_addr, primitive_name, params, db_dict=None):