This commit is contained in:
wh1te909 2020-11-25 22:19:27 +00:00
parent 4fbb613aaa
commit 824bcc5603
1 changed files with 11 additions and 3 deletions

View File

@ -500,7 +500,9 @@ class Agent(BaseAuditModel):
try:
resp = requests.post(
f"http://{settings.SALT_HOST}:8123/run", json=[json], timeout=timeout,
f"http://{settings.SALT_HOST}:8123/run",
json=[json],
timeout=timeout,
)
except Exception:
return "timeout"
@ -756,7 +758,9 @@ RECOVERY_CHOICES = [
class RecoveryAction(models.Model):
agent = models.ForeignKey(
Agent, related_name="recoveryactions", on_delete=models.CASCADE,
Agent,
related_name="recoveryactions",
on_delete=models.CASCADE,
)
mode = models.CharField(max_length=50, choices=RECOVERY_CHOICES, default="mesh")
command = models.TextField(null=True, blank=True)
@ -773,7 +777,11 @@ class RecoveryAction(models.Model):
class Note(models.Model):
agent = models.ForeignKey(Agent, related_name="notes", on_delete=models.CASCADE,)
agent = models.ForeignKey(
Agent,
related_name="notes",
on_delete=models.CASCADE,
)
user = models.ForeignKey(
"accounts.User",
related_name="user",