0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 17:51:53 +00:00

Flock: pinned version; nicer error message when submodule not found

This commit is contained in:
Maria Matejka 2024-07-23 16:44:27 +02:00
parent ee182f9869
commit 2b62caa544
2 changed files with 7 additions and 1 deletions

1
.gitmodules vendored
View File

@ -4,3 +4,4 @@
[submodule "python/flock"]
path = python/flock
url = https://gitlab.nic.cz/labs/flock
branch = v0.0

View File

@ -6,7 +6,12 @@ import pathlib
import sys
import yaml
sys.path.insert(0, "python/flock")
flock_path = pathlib.Path(__file__).parent.parent / "flock"
if not (flock_path / "README.md").exists():
print("Flock not found, have you run \"git submodule update\"?")
exit(1)
sys.path.insert(0, str(flock_path))
from flock.Hypervisor import Hypervisor
from flock.Machine import Machine