aws / aws-iot-device-sdk-python-v2

Next generation AWS IoT Client SDK for Python using the AWS Common Runtime
Apache License 2.0
408 stars 213 forks source link

Failed creation of default mqtt client #582

Closed grofonn closed 5 months ago

grofonn commented 5 months ago

Describe the bug

new_default_builder function in mqtt_client_builder.py (awsiot) doesn't pass kwargs argument as expected. It calles _builder function with kwargs as a single argument and not as a dictionary (**kwargs), which fails the creation of a mqtt client. This seems to be the exact same problem that was reported for mqtt_connection_builder in https://github.com/aws/aws-iot-device-sdk-python-v2/issues/340 and solved in https://github.com/aws/aws-iot-device-sdk-python-v2/pull/341

Expected Behavior

Pass kwargs as a dictionary (**kwargs)

Current Behavior

Pass kwargs as a single argument

Reproduction Steps

    client = mqtt5_client_builder.new_default_builder(
        endpoint=endpoint,
        port=port,
        client_id=client_id,
        username=user,
        password=password,
        clean_session=False,
        keep_alive_secs=30,
        on_connection_interrupted=self.on_connection_interrupted,
        on_connection_resumed=self.on_connection_resumed,
        on_connection_success=self.on_connect,
        on_connection_failure=self.on_connection_failure,
        on_connection_closed=self.on_disconnect)

Possible Solution

Fix new_default_builder function' calls (pass **kwargs instead of kwargs=kwargs)

Additional Information/Context

No response

SDK version used

v2

Environment details (OS name and version, etc.)

Windows 10

xiazhvera commented 5 months ago

Thank you for making this issue! I have made a PR to fix the issue: https://github.com/aws/aws-iot-device-sdk-python-v2/pull/583

I will update the ticket once the fix is released.

github-actions[bot] commented 5 months ago

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.