def checkIfNotebookRunningAndStoreLogs(notebookId, runStatus): response = Zeppelin.getNotebookDetails(notebookId) runStatus.logs = json.dumps(response) runStatus.save() isNotebookRunning = response.get("info", {}).get("isRunning", False) if not isNotebookRunning: setNotebookStatus(response, runStatus) return isNotebookRunning
def checkIfNotebookRunning(notebookId: str): response = Zeppelin.getNotebookDetails(notebookId) isNotebookRunning = response.get("info", {}).get("isRunning", False) notebookName = response.get("name", "Undefined") return isNotebookRunning, notebookName