in client/iot_client.py [0:0]
def execute_job(self, job_id):
job_details = self.open_jobs[job_id]
job_document = job_details['jobDocument']
if 'operation' in job_document.keys():
# Pretend to do something successfully
if job_document['operation'] == "FIRMWARE_UPGRADE":
self.firmware_upgrade(job_document)
elif job_document['operation'] == "ORDER_66":
self.demo_connectivity_issues()
elif job_document['operation'] == "REBOOT":
self.reboot()
else:
print("Successfully performed {0} on device".format(job_document['operation']))
return job_document['operation'], True
else:
print("Missing operation to be performed in job")
return None, False