- await self.libjuju.destroy_model(
- model_name=model_name, total_timeout=total_timeout
- )
+ if not scaling_in:
+ # destroy the model
+ # TODO: should this be removed?
+ await self.libjuju.destroy_model(
+ model_name=model_name, total_timeout=total_timeout
+ )
+ else:
+ # get juju model and observer
+ controller = await self.libjuju.get_controller()
+ model = await self.libjuju.get_model(controller, model_name)
+ # destroy the application
+ await self.libjuju.destroy_application(
+ model=model, application_name=application_name)