self.logger = logging.getLogger("lcm.vim")
self.loop = loop
self.lcm_tasks = lcm_tasks
- self.ro_config = config["ro_config"]
+ self.ro_config = config["RO"]
super().__init__(msg, self.logger)
self.logger = logging.getLogger("lcm.vim")
self.loop = loop
self.lcm_tasks = lcm_tasks
- self.ro_config = config["ro_config"]
+ self.ro_config = config["RO"]
super().__init__(msg, self.logger)
self.logger = logging.getLogger("lcm.sdn")
self.loop = loop
self.lcm_tasks = lcm_tasks
- self.ro_config = config["ro_config"]
+ self.ro_config = config["RO"]
super().__init__(msg, self.logger)
logging_text = "Task sdn_delete={} ".format(sdn_id)
self.logger.debug(logging_text + "Enter")
- db_sdn = None
+ db_sdn = {}
db_sdn_update = {}
exc = None
step = "Getting sdn from db"
logging_text + "Skipping. There is not RO information at database"
)
self.db.del_one("sdns", {"_id": sdn_id})
- db_sdn = None
+ db_sdn = {}
self.logger.debug("sdn_delete task sdn_id={} Exit Ok".format(sdn_id))
return
task2name = {}
init_target = deep_get(db_k8scluster, ("_admin", "init"))
step = "Launching k8scluster init tasks"
- for task_name in ("helm-chart", "juju-bundle", "helm-chart-v3"):
+
+ k8s_deploy_methods = db_k8scluster.get("deployment_methods", {})
+ # for backwards compatibility and all-false case
+ if not any(k8s_deploy_methods.values()):
+ k8s_deploy_methods = {
+ "helm-chart": True,
+ "juju-bundle": True,
+ "helm-chart-v3": True,
+ }
+ deploy_methods = tuple(filter(k8s_deploy_methods.get, k8s_deploy_methods))
+
+ for task_name in deploy_methods:
if init_target and task_name not in init_target:
continue
task = asyncio.ensure_future(
vca_id = vca_content["_id"]
self.logger.debug("Task vca_create={} {}".format(vca_id, "Enter"))
- db_vca = None
db_vca_update = {}
+ operation_state = "FAILED"
+ operation_details = ""
try:
self.logger.debug(
"Task vca_create={} {}".format(vca_id, "Getting vca from db")
self.logger.error("Task vca_create={} {}".format(vca_id, error_msg))
db_vca_update["_admin.operationalState"] = "ERROR"
db_vca_update["_admin.detailed-status"] = error_msg
- operation_state = "FAILED"
operation_details = error_msg
finally:
try:
db_vca_update = {}
vca_id = vca_content["_id"]
+ operation_state = "FAILED"
+ operation_details = ""
+
try:
self.logger.debug(
"Task vca_delete={} {}".format(vca_id, "Deleting vca from db")
self.logger.error("Task vca_delete={} {}".format(vca_id, error_msg))
db_vca_update["_admin.operationalState"] = "ERROR"
db_vca_update["_admin.detailed-status"] = error_msg
- operation_state = "FAILED"
operation_details = error_msg
finally:
try: