+ # TODO: Remove these commented lines
+
+ # model = await self.get_model(namespace, cluster_uuid=cluster_uuid)
+
+ # model = None
+ # namespace = self.get_namespace(cluster_uuid)
+ # controller = await self.get_controller(cluster_uuid)
+
+ # try:
+ # if namespace not in await controller.list_models():
+ # raise N2VCNotFound(message="Model {} does not exist".format(namespace))
+
+ # model = await controller.get_model(namespace)
+ # with open(kdu_model, "r") as f:
+ # bundle = yaml.safe_load(f)
+
+ # """
+ # {
+ # 'description': 'Test bundle',
+ # 'bundle': 'kubernetes',
+ # 'applications': {
+ # 'mariadb-k8s': {
+ # 'charm': 'cs:~charmed-osm/mariadb-k8s-20',
+ # 'scale': 1,
+ # 'options': {
+ # 'password': 'manopw',
+ # 'root_password': 'osm4u',
+ # 'user': 'mano'
+ # },
+ # 'series': 'kubernetes'
+ # }
+ # }
+ # }
+ # """
+ # # TODO: This should be returned in an agreed-upon format
+ # for name in bundle["applications"]:
+ # self.log.debug(model.applications)
+ # application = model.applications[name]
+ # self.log.debug(application)
+
+ # path = bundle["applications"][name]["charm"]
+
+ # try:
+ # await application.upgrade_charm(switch=path)
+ # except juju.errors.JujuError as ex:
+ # if "already running charm" in str(ex):
+ # # We're already running this version
+ # pass
+ # finally:
+ # if model:
+ # await model.disconnect()
+ # await controller.disconnect()
+ # return True