Skip to content
Merged
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
13 changes: 2 additions & 11 deletions ydb/public/tools/lib/cmds/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ def deploy(arguments):
if 'YDB_EXPERIMENTAL_PG' in os.environ:
optionals['pg_compatible_expirement'] = True

if _is_env_option_enabled('YDB_KAFKA_API_ENABLED'):
kafka_api_port = int(os.environ.get("YDB_KAFKA_PROXY_PORT", "9092"))
kafka_api_port = int(os.environ.get("YDB_KAFKA_PROXY_PORT", "0"))
if kafka_api_port != 0:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

У тебя ошибка фактическая: по дефолту возвращается "0", а сравниваешь с 0

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Предлагаю

    kafka_api_port = int(os.environ.get("YDB_KAFKA_PROXY_PORT"))
    if kafka_api_port is not None:
        ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

у меня там ещё приведение к int-у есть:

int(os.environ.get("YDB_KAFKA_PROXY_PORT", "0"))

optionals['kafka_api_port'] = kafka_api_port

configuration = KikimrConfigGenerator(
Expand Down Expand Up @@ -551,12 +551,3 @@ def start_recipe(args):
def stop_recipe(args):
arguments = produce_arguments(args)
cleanup(arguments)


def _is_true_string(s):
s = s.upper()
return s in ['1', 'TRUE', 'YES', 'ON']


def _is_env_option_enabled(name):
return _is_true_string(os.environ.get(name, "FALSE"))
Loading