From 8ade7dd62fa6cd047461c51e626c65b793ea9fec Mon Sep 17 00:00:00 2001 From: Gus Class Date: Mon, 12 Aug 2019 15:02:34 -0700 Subject: [PATCH] Fix list devices in IoT sample (#2319) --- iot/api-client/manager/manager.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/iot/api-client/manager/manager.py b/iot/api-client/manager/manager.py index fb4e0a58f59f..dc58b86c4142 100644 --- a/iot/api-client/manager/manager.py +++ b/iot/api-client/manager/manager.py @@ -704,17 +704,8 @@ def list_devices_for_gateway( device.get('numId'), device.get('id'))) - if devices.get('deviceNumIds') is not None: - for device_id in devices.get('deviceNumIds'): - device_name = '{}/devices/{}'.format( - registry_name, device_id) - device = client.projects().locations().registries().devices().get( - name=device_name).execute() - print('Id: {}\n\tName: {}\n\traw: {}'.format( - device_id, device.get('id'), device)) - else: - if not found: - print('No devices bound to gateway {}'.format(gateway_id)) + if not found: + print('No devices bound to gateway {}'.format(gateway_id)) # [END iot_list_devices_for_gateway]