Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FP-2521: Made the backend.Datavalidation regex allow dashes #181

Merged
merged 2 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading