Skip to content

Commit

Permalink
[device/celestica] Adde json return format.
Browse files Browse the repository at this point in the history
  • Loading branch information
pariwat committed Apr 24, 2020
1 parent 15d3e68 commit 784e64b
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,9 @@ def __compare_event_object(self, interrup_devices):
elif "QSFP" in device_name:
QSFP_devices[device_name] = 1 - int(self.__check_devices_status(device_name))
self.__clear_interrupt(device_name)
if len(QSFP_devices):
# if len(QSFP_devices):
json_obj['qsfp'] = QSFP_devices
if len(QSFPDD_devices):
# if len(QSFPDD_devices):
json_obj['qsfp-dd'] = QSFPDD_devices
return json.dumps(json_obj)

Expand Down Expand Up @@ -332,7 +332,11 @@ def get_change_event(self, timeout=0):
flag_change = False
else:
time.sleep(0.5)
DUMMY_TIMEOUT < 0 ? flag_change = False: DUMMY_TIMEOUT -= 1
if DUMMY_CHANGE_EVENT:
if DUMMY_TIMEOUT < 0 :
flag_change = False
else:
DUMMY_TIMEOUT -= 1

return (True , self.__compare_event_object(interrup_device))
else:
Expand Down

0 comments on commit 784e64b

Please sign in to comment.