|
|
|
@ -3,6 +3,7 @@
|
|
|
|
|
import uuid
|
|
|
|
|
import json
|
|
|
|
|
|
|
|
|
|
from celery.exceptions import SoftTimeLimitExceeded
|
|
|
|
|
from django.utils import timezone
|
|
|
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
|
from django.utils.translation import ugettext
|
|
|
|
@ -64,6 +65,9 @@ class CommandExecution(models.Model):
|
|
|
|
|
try:
|
|
|
|
|
result = runner.execute(self.command, 'all')
|
|
|
|
|
self.result = result.results_command
|
|
|
|
|
except SoftTimeLimitExceeded as e:
|
|
|
|
|
print("Run timeout than 60s")
|
|
|
|
|
self.result = {"error": str(e)}
|
|
|
|
|
except Exception as e:
|
|
|
|
|
print("Error occur: {}".format(e))
|
|
|
|
|
self.result = {"error": str(e)}
|
|
|
|
|