CLI: Updated example.py to exit if drone has no ports

This commit is contained in:
Srivats P. 2014-06-18 19:02:46 +05:30
parent 3770e4bcc3
commit ebab0e62af

View File

@ -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('---------')