From 781efd8f55f48cb15f648aad1b288cca3a38399e Mon Sep 17 00:00:00 2001 From: frikky Date: Tue, 24 Aug 2021 12:02:25 +0200 Subject: [PATCH] Fixed regex issue in conditions for app sdk --- backend/app_sdk/app_base.py | 11 +++++++++++ backend/app_sdk/build.sh | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/backend/app_sdk/app_base.py b/backend/app_sdk/app_base.py index 077795d0..a6871a4f 100644 --- a/backend/app_sdk/app_base.py +++ b/backend/app_sdk/app_base.py @@ -1748,6 +1748,17 @@ class AppBase: except AttributeError as e: self.logger.error("[WARNING] Condition smaller than failed with values %s and %s: %s" % (sourcevalue, destinationvalue, e)) return False + elif check.lower() == "re" or check.lower() == "matches regex": + try: + found = re.search(destinationvalue, sourcevalue) + except re.error as e: + print("[WARNING] Regex error in condition: %s" % e) + return False + + if found == None: + return False + + return True else: self.logger.info("Condition: can't handle %s yet. Setting to true" % check) diff --git a/backend/app_sdk/build.sh b/backend/app_sdk/build.sh index 5abb5960..6130a6a6 100644 --- a/backend/app_sdk/build.sh +++ b/backend/app_sdk/build.sh @@ -3,7 +3,7 @@ ### DEFAULT NAME=shuffle-app_sdk -VERSION=0.9.06 +VERSION=0.9.09 docker rmi docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION --force docker build . -f Dockerfile -t frikky/shuffle:app_sdk -t frikky/$NAME:$VERSION -t docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION -t ghcr.io/frikky/$NAME:$VERSION