From 2f97dfdf1580492758d31d5ed1f33d438563c24d Mon Sep 17 00:00:00 2001 From: Abdelilah Essiari Date: Thu, 22 Aug 2024 01:07:27 +0000 Subject: [PATCH] fixed janus throwing error when setting the count to 0 and applying/destroyin --- fabfed/provider/janus/janus_provider.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fabfed/provider/janus/janus_provider.py b/fabfed/provider/janus/janus_provider.py index b48e7b92..213da29c 100644 --- a/fabfed/provider/janus/janus_provider.py +++ b/fabfed/provider/janus/janus_provider.py @@ -83,9 +83,15 @@ def _validate_resource(self, resource: dict): assert resource.get(Constants.LABEL) assert resource.get(Constants.RES_TYPE) in Constants.RES_SUPPORTED_TYPES assert resource.get(Constants.RES_NAME_PREFIX) + creation_details = resource[Constants.RES_CREATION_DETAILS] + + # count was set to zero + if not creation_details['in_config_file']: + # TODO HANDLE UNINSTALL OF JANUS ON NODES ... + return + assert resource.get(Constants.RES_COUNT, 1) assert resource.get(Constants.RES_IMAGE) - self.logger.info(f"Validated:OK Resource={self.name} using {self.label}") def do_add_resource(self, *, resource: dict):