diff --git a/api_app/_version.py b/api_app/_version.py index 1cc82e6b87..fc0a8435a5 100644 --- a/api_app/_version.py +++ b/api_app/_version.py @@ -1 +1 @@ -__version__ = "0.5.7" +__version__ = "0.5.8" diff --git a/api_app/db/migrations/shared_services.py b/api_app/db/migrations/shared_services.py index 454ad60c1a..8651ccef2f 100644 --- a/api_app/db/migrations/shared_services.py +++ b/api_app/db/migrations/shared_services.py @@ -30,10 +30,13 @@ def checkMinFirewallVersion(self) -> bool: template_name = 'tre-shared-service-firewall' min_template_version = semantic_version.Version('0.4.0') - resource = self.query(query=f'SELECT * FROM c WHERE c.resourceType = "shared-service" \ + resources = self.query(query=f'SELECT * FROM c WHERE c.resourceType = "shared-service" \ AND c.templateName = "{template_name}" AND {IS_OPERATING_SHARED_SERVICE}') - template_version = semantic_version.Version(resource[0]["templateVersion"]) + if not resources: + raise ValueError(f"Expecting to have an instance of Firewall (template name {template_name}) deployed in a successful TRE deployment") + + template_version = semantic_version.Version(resources[0]["templateVersion"]) if (template_version < min_template_version): raise ValueError(f"{template_name} deployed version ({template_version}) is below minimum ({min_template_version})!",