Mentions légales du service

Skip to content
Snippets Groups Projects
Commit f6be62b0 authored by Gaétan Lepage's avatar Gaétan Lepage
Browse files

hostname: automatically extend gpuX in gpuX-perception

parent b0150d28
Branches
No related tags found
No related merge requests found
...@@ -4,6 +4,7 @@ Common options for remi commands ...@@ -4,6 +4,7 @@ Common options for remi commands
from collections import OrderedDict from collections import OrderedDict
import click import click
import re
from .config import Config from .config import Config
...@@ -15,10 +16,13 @@ def _callback_option_hostname(ctx, param, value) -> str: ...@@ -15,10 +16,13 @@ def _callback_option_hostname(ctx, param, value) -> str:
config: Config = Config() config: Config = Config()
# If no hostname was provided, use the one from the config file. # If no hostname was provided, use the one from the config file.
if value == "": if value == "":
value = config.desktop.ip_adress return config.desktop.ip_adress
if re.match(r"gpu[0-9]$", value):
value += "-perception"
# Make sure the provided hostname is a valid Inria hostname # Make sure the provided hostname is a valid Inria hostname
elif not value.endswith(".inrialpes.fr"): if not value.endswith(".inrialpes.fr"):
value += ".inrialpes.fr" value += ".inrialpes.fr"
return value return value
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment