project8 / dripline-python

python implementation of project8/dripline
Other
2 stars 0 forks source link

broadcast returns a poorly formatted reply #21

Closed wcpettus closed 7 years ago

wcpettus commented 7 years ago

Provider's _send_request appears incapable of parsing the reply of a broadcast cmd. As an example, a broadcast.set_condition returns:

2017-07-15T20:39:16[INFO    ] dripline.core.provider(137) -> [{'timestamp': u'2017-07-16T03:39:16Z', 'payload': {}, 'sender_info': {'username': u'root', 'exe': u'/home/project8/python_environments/drag_v1.8.9_drip_wp2.1.1_python3.5.5_psyl_v1.2.1_swarm_v1.4.4_hor_v2.4.15/bin/psyllid', 'package': u'Psyllid', 'service_name': u'unknown', 'hostname': u'zeppelin', 'version': u'1.2.1', 'commit': u'e907c28e36032ccb97b261c0c5d90afe6bbd2180'}, 'return_msg': u'No action taken (default method)', 'retcode': 0}, {'timestamp': u'2017-07-16T03:39:16Z', 'payload': {}, 'sender_info': {'username': u'root', 'exe': u'/home/project8/python_environments/drag_v1.8.9_drip_wp2.1.1_python3.5.5_psyl_v1.2.1_swarm_v1.4.4_hor_v2.4.15/bin/psyllid', 'package': u'Psyllid', 'service_name': u'unknown', 'hostname': u'zeppelin', 'version': u'1.2.1', 'commit': u'e907c28e36032ccb97b261c0c5d90afe6bbd2180'}, 'return_msg': u'No action taken (default method)', 'retcode': 0}, {'timestamp': u'2017-07-16T03:39:16Z', 'payload': {}, 'sender_info': {'username': u'root', 'exe': u'/home/project8/python_environments/drag_v1.8.9_drip_wp2.1.1_python3.5.5_psyl_v1.2.1_swarm_v1.4.4_hor_v2.4.15/bin/psyllid', 'package': u'Psyllid', 'service_name': u'unknown', 'hostname': u'zeppelin', 'version': u'1.2.1', 'commit': u'e907c28e36032ccb97b261c0c5d90afe6bbd2180'}, 'return_msg': u'No action taken (default method)', 'retcode': 0}, {'timestamp': u'2017-07-16T03:39:16Z', 'payload': {u'values': [None]}, 'sender_info': {'username': u'project8', 'exe': u'/home/project8/python_environments/latest_version/bin/dragonfly', 'package': u'dripline', 'service_name': u'roach2_service', 'hostname': u'zeppelin', 'version': u'wp2.1.1', 'commit': u'g5ae7678'}, 'return_msg': u'operation completed silently', 'retcode': 0}, {'timestamp': u'2017-07-16T03:39:16Z', 'payload': {u'values': [None]}, 'sender_info': {'username': u'project8', 'exe': u'/home/project8/python_environments/latest_version/bin/dragonfly', 'package': u'dripline', 'service_name': u'pinger_service', 'hostname': u'myrna', 'version': u'wp2.1.1', 'commit': u'g5ae7678'}, 'return_msg': u'operation completed silently', 'retcode': 0}, {'timestamp': u'2017-07-16T03:39:16Z', 'payload': {u'values': [None]}, 'sender_info': {'username': u'project8', 'exe': u'/home/project8/python_environments/latest_version/bin/dragonfly', 'package': u'dripline', 'service_name': u'slow_control_snapshot_service', 'hostname': u'myrna', 'version': u'wp2.1.1', 'commit': u'g5ae7678'}, 'return_msg': u'operation completed silently', 'retcode': 0}, {'timestamp': u'2017-07-16T03:39:16Z', 'payload': {u'values': [None]}, 'sender_info': {'username': u'project8', 'exe': u'/home/project8/python_environments/latest_version/bin/dragonfly', 'package': u'dripline', 'service_name': u'run_table_service', 'hostname': u'myrna', 'version': u'wp2.1.1', 'commit': u'g5ae7678'}, 'return_msg': u'operation completed silently', 'retcode': 0}, {'timestamp': u'2017-07-16T03:39:16Z', 'payload': {u'values': [None]}, 'sender_info': {'username': u'project8', 'exe': u'/home/project8/python_environments/latest_version/bin/dragonfly', 'package': u'dripline', 'service_name': u'r2_channel_a_daq_service', 'hostname': u'zeppelin', 'version': u'wp2.1.1', 'commit': u'g5ae7678'}, 'return_msg': u'operation completed silently', 'retcode': 0}, {'timestamp': u'2017-07-16T03:39:16Z', 'payload': {u'values': [None]}, 'sender_info': {'username': u'project8', 'exe': u'/home/project8/python_environments/latest_version/bin/dragonfly', 'package': u'dripline', 'service_name': u'r2_channel_c_daq_service', 'hostname': u'zeppelin', 'version': u'wp2.1.1', 'commit': u'g5ae7678'}, 'return_msg': u'operation completed silently', 'retcode': 0}, {'timestamp': u'2017-07-16T03:39:16Z', 'payload': {u'values': [None]}, 'sender_info': {'username': u'project8', 'exe': u'/home/project8/python_environments/latest_version/bin/dragonfly', 'package': u'dripline', 'service_name': u'slow_control_table', 'hostname': u'myrna', 'version': u'wp2.1.1', 'commit': u'g5ae7678'}, 'return_msg': u'operation completed silently', 'retcode': 0}, {'timestamp': u'2017-07-16T03:39:16Z', 'payload': {u'values': [None]}, 'sender_info': {'username': u'project8', 'exe': u'/home/project8/python_environments/latest_version/bin/dragonfly', 'package': u'dripline', 'service_name': u'r2_channel_b_daq_service', 'hostname': u'zeppelin', 'version': u'wp2.1.1', 'commit': u'g5ae7678'}, 'return_msg': u'operation completed silently', 'retcode': 0}, {'timestamp': u'2017-07-16T03:39:16Z', 'payload': {u'values': [None]}, 'sender_info': {'username': u'project8', 'exe': u'/home/project8/python_environments/latest_version/bin/dragonfly', 'package': u'dripline', 'service_name': u'psyllid_service', 'hostname': u'zeppelin', 'version': u'wp2.1.1', 'commit': u'g5ae7678'}, 'return_msg': u'operation completed silently', 'retcode': 0}, {'timestamp': u'2017-07-16T03:39:16Z', 'payload': {u'values': [None]}, 'sender_info': {'username': u'project8', 'exe': u'/home/project8/python_environments/latest_version/bin/dragonfly', 'package': u'dripline', 'service_name': u'slack_interface', 'hostname': u'myrna', 'version': u'wp2.1.1', 'commit': u'g5ae7678'}, 'return_msg': u'operation completed silently', 'retcode': 0}]

But _send_request expects a dict with a "retcode" key to check, and then returns the "payload" element. Both of these will fail from this list.

wcpettus commented 7 years ago

fixed in v3.5.6 by PR #22; this will return None