diff --git a/module_utils/kafka_lib_commons.py b/module_utils/kafka_lib_commons.py index b321c19c..b9879f3e 100644 --- a/module_utils/kafka_lib_commons.py +++ b/module_utils/kafka_lib_commons.py @@ -168,7 +168,7 @@ default='PLAINTEXT' ), - api_version=dict(type='str', required=True, default=None), + api_version=dict(type='str', default=None), ssl_check_hostname=dict( default=True, @@ -236,7 +236,7 @@ def get_manager_from_params(params): api_version = tuple( int(p) for p in params['api_version'].strip(".").split(".") - ) + ) if params.get('api_version') else None kafka_ssl_files = generate_ssl_object( ssl_cafile, ssl_certfile, ssl_keyfile, ssl_crlfile diff --git a/molecule/default/tests/ansible_utils.py b/molecule/default/tests/ansible_utils.py index 65f1f96d..a34fd3b6 100644 --- a/molecule/default/tests/ansible_utils.py +++ b/molecule/default/tests/ansible_utils.py @@ -125,9 +125,7 @@ def call_kafka_stat_lag( else: envs = env_no_sasl for env in envs: - protocol_version = env['protocol_version'] module_args = { - 'api_version': protocol_version, 'bootstrap_servers': env['kfk_addr'], } module_args.update(args) @@ -149,9 +147,7 @@ def call_kafka_info( else: envs = env_no_sasl for env in envs: - protocol_version = env['protocol_version'] module_args = { - 'api_version': protocol_version, 'bootstrap_servers': env['kfk_addr'], } module_args.update(args) @@ -174,10 +170,7 @@ def call_kafka_lib( else: envs = env_no_sasl for env in envs: - protocol_version = env['protocol_version'] - module_args = { - 'api_version': protocol_version, 'zookeeper': env['zk_addr'], 'bootstrap_servers': env['kfk_addr'], } @@ -201,10 +194,7 @@ def call_kafka_topic_with_zk( else: envs = env_no_sasl for env in envs: - protocol_version = env['protocol_version'] - module_args = { - 'api_version': protocol_version, 'zookeeper': env['zk_addr'], 'bootstrap_servers': env['kfk_addr'], } @@ -235,7 +225,6 @@ def call_kafka_topic( continue module_args = { - 'api_version': protocol_version, 'bootstrap_servers': env['kfk_addr'], } module_args.update(args) @@ -265,7 +254,6 @@ def call_kafka_topics( continue module_args = { - 'api_version': protocol_version, 'bootstrap_servers': env['kfk_addr'], } module_args.update(args) @@ -295,7 +283,6 @@ def call_kafka_quotas( continue module_args = { - 'api_version': protocol_version, 'zookeeper': env['zk_addr'], 'bootstrap_servers': env['kfk_addr'], } @@ -319,10 +306,7 @@ def call_kafka_acl( else: envs = env_no_sasl for env in envs: - protocol_version = env['protocol_version'] - module_args = { - 'api_version': protocol_version, 'bootstrap_servers': env['kfk_addr'], } module_args.update(args) @@ -345,10 +329,7 @@ def call_kafka_acls( else: envs = env_no_sasl for env in envs: - protocol_version = env['protocol_version'] - module_args = { - 'api_version': protocol_version, 'bootstrap_servers': env['kfk_addr'], } module_args.update(args)