aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/VatExecutor.py
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2018-01-05 08:45:07 +0000
committerPeter Mikus <pmikus@cisco.com>2018-01-05 08:48:05 +0000
commitb5fe0fd9a4266773125cc4d4c1edaa1c1a8a1731 (patch)
tree5791a955ce0a15ad4ae2e8430251911089b7270b /resources/libraries/python/VatExecutor.py
parent806281e10438c0e1003c6f0a070a85f5ca40bec9 (diff)
VatHistory: Add ability to trace file executions
Change-Id: I9f6de8d2b86ddbbdf1524dcc12d8ed5a33b3266e Signed-off-by: Peter Mikus <pmikus@cisco.com>
Diffstat (limited to 'resources/libraries/python/VatExecutor.py')
-rw-r--r--resources/libraries/python/VatExecutor.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/resources/libraries/python/VatExecutor.py b/resources/libraries/python/VatExecutor.py
index febfe9fa57..de6baababe 100644
--- a/resources/libraries/python/VatExecutor.py
+++ b/resources/libraries/python/VatExecutor.py
@@ -152,6 +152,9 @@ class VatExecutor(object):
vat=Constants.VAT_BIN_NAME,
input=vat_name)
+ with open(vat_name, 'r') as tmp_f:
+ VatHistory.add_to_vat_history(node, tmp_f.read())
+
try:
(ret_code, stdout, stderr) = ssh.exec_command(cmd, timeout)
except SSHTimeout:
@@ -197,6 +200,10 @@ class VatExecutor(object):
vat=Constants.VAT_BIN_NAME)
cmd_input = "exec exec {0}".format(fname)
+ VatHistory.add_to_vat_history(node, cmd_input)
+ with open(fname, 'r') as tmp_f:
+ VatHistory.add_to_vat_history(node, tmp_f.read())
+
try:
(ret_code, stdout, stderr) = ssh.exec_command_sudo(cmd, cmd_input,
timeout)