Skip to content

Commit

Permalink
fix parse env. vars. in python client - rk
Browse files Browse the repository at this point in the history
  • Loading branch information
rjojjr committed Sep 28, 2024
1 parent 9d5a6cd commit c11727a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions client-modules/python/src/taskslock/client/utils/host_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@


def get_host() -> str:
try:
return os.environ.get('TASKS_LOCK_API_HOST')
except Exception as e:
return 'localhost'
host = os.environ.get('TASKS_LOCK_API_HOST')
return host if host is not None else 'localhost'


def get_protocol() -> str:
try:
return os.environ.get('TASKS_LOCK_API_PROTOCOL')
except Exception as e:
return 'http'
proto = os.environ.get('TASKS_LOCK_API_PROTOCOL')
return proto if proto is not None else 'http'


def get_port() -> int:
Expand Down

0 comments on commit c11727a

Please sign in to comment.