Acknowledge from the user, he/she has alredy watched the status. Update the acknowledgement status, if the process is still running. And, delete the process information from the configuration, and the log files related to the process, if it has already been complete
(_pid)
| 798 | |
| 799 | @staticmethod |
| 800 | def acknowledge(_pid): |
| 801 | """ |
| 802 | Acknowledge from the user, he/she has alredy watched the status. |
| 803 | |
| 804 | Update the acknowledgement status, if the process is still running. |
| 805 | And, delete the process information from the configuration, and the log |
| 806 | files related to the process, if it has already been completed. |
| 807 | """ |
| 808 | p = Process.for_user(pid=_pid).first() |
| 809 | |
| 810 | if p is None: |
| 811 | raise LookupError(PROCESS_NOT_FOUND) |
| 812 | |
| 813 | if p.end_time is not None: |
| 814 | logdir = p.logdir |
| 815 | db.session.delete(p) |
| 816 | import shutil |
| 817 | shutil.rmtree(logdir, True) |
| 818 | else: |
| 819 | p.acknowledge = get_current_time() |
| 820 | |
| 821 | db.session.commit() |
| 822 | |
| 823 | def set_env_variables(self, server, **kwargs): |
| 824 | """Set environment variables""" |
no test coverage detected