Skip to content

Commit fa341e4

Browse files
authored
Adds check for missing gateway ID on gateway commands (GoogleCloudPlatform#2780)
* Adds check for missing gateway ID on gateway commands * Adds back flaky directive
1 parent 406305a commit fa341e4

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

iot/api-client/mqtt_example/cloudiot_mqtt_example.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,11 @@ def mqtt_device_demo(args):
482482
def main():
483483
args = parse_command_line_args()
484484

485+
if args.command.startswith('gateway'):
486+
if (args.gateway_id is None):
487+
print('Error: For gateway commands you must specify a gateway ID')
488+
return
489+
485490
if args.command == 'gateway_listen':
486491
listen_for_messages(
487492
args.service_account_json, args.project_id,

iot/api-client/mqtt_example/cloudiot_mqtt_example_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ def test_gateway_listen_for_bound_device_configs(test_topic, capsys):
280280
assert 'Received message' in out
281281

282282

283+
@flaky
283284
def test_gateway_send_data_for_device(test_topic, capsys):
284285
gateway_id = device_id_template.format('RS256')
285286
device_id = device_id_template.format('noauthbind')

0 commit comments

Comments
 (0)