diff --git a/docker-compose-config.py b/docker-compose-config.py old mode 100755 new mode 100644 index 2a154c265ff..df1369becc3 --- a/docker-compose-config.py +++ b/docker-compose-config.py @@ -2,8 +2,13 @@ import secrets import string from typing import Optional -import yaml -from yaml.loader import FullLoader +try: + import yaml + from yaml.loader import FullLoader +except ImportError: + raise ImportError( + "Missing pyyaml! Install it with command `python3 -m pip install pyyaml` to run this configurator." + ) FILE_PATH = "docker-compose.yml" @@ -76,4 +81,7 @@ def main(): if __name__ == "__main__": - main() + try: + main() + except KeyboardInterrupt: + print("\nConfiguration canceled.") diff --git a/docker-compose-config.sh b/docker-compose-config.sh new file mode 100755 index 00000000000..fd6a1fab73a --- /dev/null +++ b/docker-compose-config.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +set -ex +python3 -m pip install pyyaml +echo +python3 docker-compose-config.py