diff --git a/HISTORY.rst b/HISTORY.rst index 0fa0ccb33..9f58eb543 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,14 @@ Release History =============== +0.8.9 ++++++++++++++++ +- Updated uamqp version to ~1.2. +- Simplified out-of-band dependency installation message. +- If uamqp installation fails the error is raised on stderr rather than having to use --debug. +- amqp frame traces are not shown when --debug is passed in to event monitoring. +- Fixed monitor-events not raising an exception if receiver client runs into an error. + 0.8.8 +++++++++++++++ - Adds Jobs v2 command set. diff --git a/azext_iot/operations/events3/_events.py b/azext_iot/operations/events3/_events.py index 939ec70b1..15f9bac36 100644 --- a/azext_iot/operations/events3/_events.py +++ b/azext_iot/operations/events3/_events.py @@ -88,10 +88,10 @@ def stop_and_suppress_eloop(): loop.run_forever() finally: if result: - error = next(res for res in result if result) - if error: - logger.error(error) - raise RuntimeError(error) + errors = result[0] + if errors and errors[0]: + logger.debug(errors) + raise RuntimeError(errors[0]) async def initiate_event_monitor( @@ -148,7 +148,7 @@ def _get_conn_props(): pnp_context=pnp_context, ) ) - await asyncio.gather(*coroutines, return_exceptions=True) + return await asyncio.gather(*coroutines, return_exceptions=True) async def monitor_events( @@ -254,7 +254,7 @@ def _output_msg_kpi(msg): exp_cancelled = False receive_client = uamqp.ReceiveClientAsync( - source, auth=auth, timeout=timeout, prefetch=0, debug=DEBUG + source, auth=auth, timeout=timeout, prefetch=0, client_name=_get_container_id(), debug=DEBUG ) try: diff --git a/azext_iot/operations/hub.py b/azext_iot/operations/hub.py index 0813d7b2f..91ea8d3a9 100644 --- a/azext_iot/operations/hub.py +++ b/azext_iot/operations/hub.py @@ -1318,10 +1318,13 @@ def iot_device_upload_file(cmd, device_id, file_path, content_type, hub_name=Non def iot_hub_monitor_events(cmd, hub_name=None, device_id=None, consumer_group='$Default', timeout=300, enqueued_time=None, resource_group_name=None, yes=False, properties=None, repair=False, login=None, content_type=None, device_query=None): - _iot_hub_monitor_events(cmd, hub_name=hub_name, device_id=device_id, - consumer_group=consumer_group, timeout=timeout, enqueued_time=enqueued_time, - resource_group_name=resource_group_name, yes=yes, properties=properties, - repair=repair, login=login, content_type=content_type, device_query=device_query) + try: + _iot_hub_monitor_events(cmd, hub_name=hub_name, device_id=device_id, + consumer_group=consumer_group, timeout=timeout, enqueued_time=enqueued_time, + resource_group_name=resource_group_name, yes=yes, properties=properties, + repair=repair, login=login, content_type=content_type, device_query=device_query) + except RuntimeError as e: + raise CLIError(e) def iot_hub_monitor_feedback(cmd, hub_name=None, device_id=None, yes=False,