From ebab0e62afd9e13866ef9b24a4390a3f27135afe Mon Sep 17 00:00:00 2001 From: "Srivats P." Date: Wed, 18 Jun 2014 19:02:46 +0530 Subject: [PATCH] CLI: Updated example.py to exit if drone has no ports --- binding/example.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/binding/example.py b/binding/example.py index 9ee39ad..6694f17 100644 --- a/binding/example.py +++ b/binding/example.py @@ -70,6 +70,10 @@ try: log.info('retreiving port config for all ports') port_config_list = drone.getPortConfig(port_id_list) + if len(port_config_list.port) == 0: + log.warning('drone has no ports!') + sys.exit(1) + # print port list and get tx/rx port id print('Port List') print('---------')