Skip to content

Commit

Permalink
Merge pull request #181 from MOV-AI/bugfix/FP-2521-config-key-not-found
Browse files Browse the repository at this point in the history
FP-2521: Made the backend.Datavalidation regex allow dashes
  • Loading branch information
diasnad authored Aug 11, 2023
2 parents 77a9307 + e416369 commit 66827f0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
4 changes: 2 additions & 2 deletions database/Callback/backend.DataValidation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import re
try:
from dal.scopes import ScopesTree
from dal.models.scopestree import ScopesTree
except ImportError:
from movai.data import ScopesTree

Expand All @@ -21,7 +21,7 @@ def validate_configuration(config_string):
"""
try:
regex = r"^\$\(config \w+(\.\w+)*\)$"
regex = r"^\$\(config [\w-]+(\.[\w-]+)*\)"
matches = re.finditer(regex, config_string, re.MULTILINE)
matches_size = len([x for x in matches])
if matches_size == 0:
Expand Down
28 changes: 28 additions & 0 deletions scripts/import_callback.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#! /bin/bash

robot_name=$1;

if [ -z $robot_name ]
then
echo "ERROR: Robot name is required:"
echo " ./import_callback.sh <robot_name>"
exit 1
fi

backend_container="backend-${robot_name}-movai";
echo "Attempting to enter ${backend_container}";

if [ ! "$(docker ps -q -f name=${backend_container})" ]; then
echo "The container ${backend_container} is not running. Please start your robot and try again."
exit 1
fi

docker cp -a database/ ${backend_container}:/opt/mov.ai/app
docker exec -i ${backend_container} bash <<!
export PYTHONPATH=/opt/mov.ai/app
python3 -m tools.backup -a import -p database/ -r /opt/mov.ai/app/
!


echo "DONE! All callbacks were imported."
exit 0

0 comments on commit 66827f0

Please sign in to comment.