Browse Source

Merge "Renamed variable to something more illuminating."

changes/89/781089/3
Zuul 6 days ago
committed by Gerrit Code Review
parent
commit
f4c7f00120
4 changed files with 7 additions and 7 deletions
  1. +3
    -3
      validations_common/callback_plugins/validation_json.py
  2. +1
    -1
      validations_common/callback_plugins/validation_stdout.py
  3. +2
    -2
      validations_common/tests/callback_plugins/test_validation_json.py
  4. +1
    -1
      validations_common/tests/callback_plugins/test_validation_stdout.py

+ 3
- 3
validations_common/callback_plugins/validation_json.py View File

@ -68,7 +68,7 @@ class CallbackModule(CallbackBase):
self.results = []
self.simple_results = []
self.env = {}
self.t0 = None
self.start_time = None
self.current_time = current_time()
def _new_play(self, play):
@ -115,7 +115,7 @@ class CallbackModule(CallbackBase):
}
def v2_playbook_on_start(self, playbook):
self.t0 = time.time()
self.start_time = time.time()
pl = playbook._file_name
validation_id = os.path.splitext(os.path.basename(pl))[0]
self.env = {
@ -181,7 +181,7 @@ class CallbackModule(CallbackBase):
self.simple_results[-1]['task']['hosts'][host.name] = task_result
end_time = current_time()
time_elapsed = secondsToStr(time.time() - self.t0)
time_elapsed = secondsToStr(time.time() - self.start_time)
for result in self.results:
if len(result['tasks']) > 1:
result['tasks'][-1]['task']['duration']['end'] = end_time


+ 1
- 1
validations_common/callback_plugins/validation_stdout.py View File

@ -52,7 +52,7 @@ class CallbackModule(CallbackBase):
def __init__(self, display=None):
super(CallbackModule, self).__init__(display)
self.env = {}
self.t0 = None
self.start_time = None
self.current_time = current_time()
def _new_play(self, play):


+ 2
- 2
validations_common/tests/callback_plugins/test_validation_json.py View File

@ -90,7 +90,7 @@ class TestValidationJson(base.TestCase):
self.assertEqual(callback.results, [])
self.assertEqual(callback.simple_results, [])
self.assertEqual(callback.env, {})
self.assertIsNone(callback.t0)
self.assertIsNone(callback.start_time)
"""
Callback time sanity check only verifies general format
of the stored time to be iso format `YYYY-MM-DD HH:MM:SS.mmmmmm`
@ -396,7 +396,7 @@ class TestValidationJson(base.TestCase):
callback = validation_json.CallbackModule()
callback.results = callback_results
callback.simple_results = callback_simple_results
callback.t0 = 0
callback.start_time = 0
callback._record_task_result(mock_on_info, mock_result)


+ 1
- 1
validations_common/tests/callback_plugins/test_validation_stdout.py View File

@ -91,7 +91,7 @@ class TestValidationStdout(base.TestCase):
"""
self.assertEqual(callback.env, {})
self.assertIsNone(callback.t0)
self.assertIsNone(callback.start_time)
"""
Callback time sanity check only verifies general format
of the stored time to be iso format `YYYY-MM-DD HH:MM:SS.mmmmmm`


Loading…
Cancel
Save