From 6c81456d90ddbd4b94244b172ccae307b36463df Mon Sep 17 00:00:00 2001 From: Etienne Pallier Date: Fri, 22 Mar 2019 12:39:07 +0100 Subject: [PATCH] Nouvelle méthode command.get_updated_result() --- README.md | 2 +- src/agent/Agent.py | 8 ++++---- src/common/models.py | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fc51821..978a000 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ Date: 22/03/2019 Author: E. Pallier -VERSION: 0.20.25 +VERSION: 0.20.26 Comment: mode "test" (-t) géré (= mode simulateur) diff --git a/src/agent/Agent.py b/src/agent/Agent.py index 3924ab9..a0248b7 100755 --- a/src/agent/Agent.py +++ b/src/agent/Agent.py @@ -704,7 +704,7 @@ class Agent: if param['section']=="assembly" and param['key']=="alias": assembled_aliases.append(param['value']) #print(f"Unit {unit_alias} is the assembly of {assembled_aliases}") - + print("--------- Components of the unit -----------") print("Configuration file is {}".format(self.config.get_configfile())) alias = self.config.get_aliases('unit')[0] @@ -722,15 +722,15 @@ class Agent: assembled_mount_aliases.append(alias) elif unit_subtag=="channel": assembled_channel_aliases.append(alias) - + print("--------- Assembly of the unit -----------") print(f"Assembled mount aliases: {assembled_mount_aliases}") print(f"Assembled channel aliases: {assembled_channel_aliases}") - + # --- Get the home of the mount[0] mount_alias = assembled_mount_aliases[0] home = self.config.get_param(mount_alias,'MountPointing','home') - + print("------------------------------------------") hostname = socket.gethostname() self._computer_alias = '' diff --git a/src/common/models.py b/src/common/models.py index 822ca46..863f58d 100644 --- a/src/common/models.py +++ b/src/common/models.py @@ -482,6 +482,10 @@ class Command(models.Model): def get_result(self): return self.result + def get_updated_result(self): + self.refresh_from_db() + return self.result + def set_result(self, result:str): self.result = result self.save() -- libgit2 0.21.2