Property was simplified to be more readable
and optimized so it doesn't loop over all stats
if it doesn't need to.
Reference to unsupported return value was removed.
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I887b6e0d1e561b965f1c6d5119c7cb54cf30f1d2
This patch adds a new col in the result table with the reason
of the failure. It avoid to dig into the logs for each failed
validations.
Example:
https://paste.opendev.org/show/809351/
Change-Id: I4723b87b71390e1364480a8ca93e7dc7b3e654a5
Redundant checks were removed an branching reduced.
Previously de-facto function _get_content now behaves as
a method should and works with attributes.
Several string processsing snippets were factored out
and are now separate helper methods.
Added check for abs path.
Changed related test to provide absolute path.
Added new test case for absolute path checking.
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I46df7b4befbef36a74b9138961650806c457fc13
All python classes already inherit from object implicitly.
There is no need to keep it there.
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: Ic56242fc20ef27e4b96b09319280e87db130e4cb
This patch also uses pycqa/flake8 instead of the default one proposed by
pre-commit and which is deprecated.
Change-Id: Iba243abc1ec01912edb4b3645f8ccce95e0f2e88
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
This patch also adds new unittests.
Change-Id: I6f299db1b22d98fdabc148e297098e023cf863bd
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Show history filtered by plays to get a better view
if a log file contains a lot of playbooks.
Add get_status action in order to get debug information
of a given validation failure
Change-Id: I29ab90647d9ef9c86546065ca16a62c401be1969
Since the user can provide a path to a directory which can
be polute by undesirable files, filter by extension can avoid
parsing wrong files
Change-Id: I378b32d58cd1ec3a5688bba0831716bf94f18f05
We need to catch ValueError when we extract log information
from the file name provided by user.
Instead of raising an exception, we just log a warning to the
user. The normal usage can handle None uuid or timestamp or
validation-id.
This will aim to make the ValidationLog class more generic.
Change-Id: Iccc2a37b4c2c911e634a210de253ba1111e5b7e7
When missing datas in ansible log for some reasons,
we need to avoid None value, and just ignore it.
Change-Id: Ic6e05bf65bf01eeafd5e9222f3410a4dc5a50c9e
Increase the unit tests coverage for recent code:
validation, group and logs classes.
(Increase of 54 unit tests)
Move per action files into one test file:
test_validation_actions
Change-Id: I7a1a8b0681c13ebd758a5686b2398a0a9e87a4eb
Create two classes for Log and Logs in order to get
a simpler representation of the validation Log and
provide easy way to manage the log data informations
Change-Id: I743355cef943e43492264d4c4700bebbeab9a37d