compliance-trestle
compliance-trestle copied to clipboard
trestle incorrectly displays abstract base class an option for a trestle task
Describe the bug
Trestle incorrectly advertises a task that is actually the abstract base class when running trestle task -l
called base
. This should be proactively excluded from the list of tasks.
To Reproduce
- List tasks and see base:
trestle task -l
Available tasks:
pass-fail
base
cis-xlsx-to-oscal-catalog
csv-to-oscal-cd
ocp4-cis-profile-to-oscal-catalog
ocp4-cis-profile-to-oscal-cd
oscal-catalog-to-csv
oscal-profile-to-osco-profile
osco-result-to-oscal-ar
tanium-result-to-oscal-ar
xccdf-result-to-oscal-ar
xlsx-to-oscal-cd
xlsx-to-oscal-profile
- Attempt to find out about 'base'
trestle task base -i
trestle.core.commands.task:101 WARNING: Config file was not configured with the appropriate section for the task: "[task.base]"
trestle.core.commands.task:94 ERROR: Error while executing Trestle task: Can't instantiate abstract class TaskBase without an implementation for abstract methods 'execute', 'print_info', 'simulate'
Expected behavior
base
should not be listed among the available tasks. Ideally base would also report that it does not exist as opposed to thee error shown.
Note on the warning: expecting the config file has to be configured for a task seems strange. Maybe this should be added as flag that is explicitly checked based on whether the defined task expects it.
Screenshots / Logs.
See above
Environment
- OS: [e.g. iOS] Mac OS 14.5
- Python version: 3.12 (although should occur on lower versions)
- Installed packages:
pip list
Package Version
----------------------------------------- ---------------
annotated-types 0.7.0
anyio 4.4.0
appnope 0.1.4
argcomplete 3.3.0
argon2-cffi 23.1.0
argon2-cffi-bindings 21.2.0
arrow 1.3.0
asgiref 3.8.1
astroid 3.2.2
asttokens 2.4.1
async-lru 2.0.4
attrs 23.2.0
Babel 2.15.0
bcrypt 4.1.3
beautifulsoup4 4.12.3
black 24.4.2
bleach 6.1.0
blinker 1.8.2
bracex 2.4
cairocffi 1.7.0
CairoSVG 2.7.1
certifi 2024.6.2
cffi 1.16.0
cfgv 3.4.0
charset-normalizer 3.3.2
click 8.1.7
click-log 0.4.0
click-option-group 0.5.6
cmarkgfm 2024.1.14
codeflare-sdk 0.1.7
codespell 2.3.0
colorama 0.4.6
comm 0.2.2
commonmark 0.9.1
compliance-trestle 3.3.0
coverage 7.5.3
cryptography 42.0.4
cssselect2 0.7.0
datamodel-code-generator 0.25.3
debugpy 1.8.1
decorator 5.1.1
defusedxml 0.7.1
dep-logic 0.2.0
Deprecated 1.2.14
dill 0.3.8
distlib 0.3.8
Django 5.0.6
dnspython 2.6.1
docutils 0.21.2
dotty-dict 1.3.1
editdistpy 0.1.4
email_validator 2.1.1
et-xmlfile 1.1.0
execnet 2.1.1
executing 2.0.1
fastjsonschema 2.19.1
filelock 3.14.0
findpython 0.6.1
flake8 7.0.0
fqdn 1.5.1
furl 2.1.3
genson 1.3.0
ghp-import 2.1.0
gitdb 4.0.11
GitPython 3.1.43
h11 0.14.0
hishel 0.0.29
httpcore 1.0.5
httpx 0.27.0
identify 2.5.36
idna 3.7
ilcli 0.3.2
importlib_metadata 7.1.0
importlib_resources 6.4.0
inflect 5.6.2
iniconfig 2.0.0
installer 0.7.0
invoke 1.7.3
ipykernel 6.29.4
ipython 8.24.0
isoduration 20.11.0
isort 5.13.2
jaraco.classes 3.4.0
jaraco.context 5.3.0
jaraco.functools 4.0.1
jedi 0.19.1
Jinja2 3.1.4
json5 0.9.25
jsonpointer 2.4
jsonschema 4.22.0
jsonschema-specifications 2023.12.1
jupyter_client 8.6.2
jupyter_core 5.7.2
jupyter-events 0.10.0
jupyter-lsp 2.2.5
jupyter_server 2.14.0
jupyter_server_terminals 0.5.3
jupyterlab 4.2.1
jupyterlab_pygments 0.3.0
jupyterlab_server 2.27.2
keyring 25.2.1
lexicon 2.0.1
livereload 2.6.3
Markdown 3.6
markdown-include 0.8.1
markdown-it-py 3.0.0
MarkupSafe 2.1.5
matplotlib-inline 0.1.7
mccabe 0.7.0
mdurl 0.1.2
mergedeep 1.3.4
mistune 3.0.2
mkdocs 1.6.0
mkdocs-autorefs 1.0.1
mkdocs-awesome-pages-plugin 2.9.2
mkdocs-exclude 1.0.2
mkdocs-get-deps 0.2.0
mkdocs-git-revision-date-localized-plugin 1.2.6
mkdocs-glightbox 0.4.0
mkdocs-htmlproofer-plugin 1.2.1
mkdocs-macros-plugin 1.0.5
mkdocs-material 9.5.26
mkdocs-material-extensions 1.3.1
mkdocs-spellcheck 1.1.0
mkdocs-table-reader-plugin 2.2.2
mkdocs-unused-files 0.2.0
mkdocstrings 0.19.0
mkdocstrings-python-legacy 0.2.3
more-itertools 10.2.0
msgpack 1.0.8
mypy 1.10.0
mypy-extensions 1.0.0
natsort 8.4.0
nbclient 0.10.0
nbconvert 7.16.4
nbformat 5.10.4
nest-asyncio 1.6.0
nh3 0.2.17
nodeenv 1.9.0
notebook_shim 0.2.4
numpy 1.26.4
openpyxl 3.1.3
openshift-client 1.0.18
orderedmultidict 1.0.1
orjson 3.10.3
overrides 7.7.0
packaging 24.0
paginate 0.5.6
pandas 2.2.2
pandocfilters 1.5.1
paramiko 3.4.0
parso 0.8.4
pathspec 0.12.1
pbs-installer 2024.4.24
pdm 2.15.4
pep8-naming 0.14.1
pexpect 4.9.0
pillow 10.3.0
pip 24.0
pkginfo 1.11.0
platformdirs 4.2.2
pluggy 1.5.0
pre-commit 3.7.1
prometheus_client 0.20.0
prompt-toolkit 3.0.43
psutil 5.9.8
ptyprocess 0.7.0
pure-eval 0.2.2
pycodestyle 2.11.1
pycparser 2.22
pydantic 2.8.2
pydantic_core 2.20.1
pyflakes 3.2.0
PyGithub 2.3.0
Pygments 2.18.0
PyJWT 2.8.0
pylint 3.2.2
pymdown-extensions 10.8.1
PyNaCl 1.5.0
pyproject_hooks 1.1.0
pytest 8.2.1
pytest-cov 5.0.0
pytest-random-order 1.1.1
pytest-xdist 3.6.1
python-dateutil 2.9.0.post0
python-dotenv 1.0.1
python-frontmatter 1.1.0
python-gitlab 4.6.0
python-json-logger 2.0.7
python-semantic-release 9.8.0
pytkdocs 0.16.1
pytz 2024.1
PyYAML 6.0.1
pyyaml_env_tag 0.1
pyzmq 26.0.3
readme_renderer 43.0
referencing 0.35.1
regex 2022.10.31
requests 2.32.3
requests-toolbelt 1.0.0
resolvelib 1.0.1
rfc3339-validator 0.1.4
rfc3986 2.0.0
rfc3986-validator 0.1.1
rich 13.7.1
rpds-py 0.18.1
ruamel.yaml 0.18.6
ruamel.yaml.clib 0.2.8
semver 2.13.0
Send2Trash 1.8.3
setuptools 70.0.0
shellingham 1.5.4
six 1.16.0
smmap 5.0.1
sniffio 1.3.1
socksio 1.0.0
soupsieve 2.5
sqlparse 0.5.0
stack-data 0.6.3
symspellpy 6.7.7
tabulate 0.9.0
termcolor 2.4.0
terminado 0.18.1
tinycss2 1.3.0
tomli 2.0.1
tomlkit 0.12.5
tornado 6.4
tqdm 4.66.4
traitlets 5.14.3
truststore 0.9.1
twine 3.8.0
types-paramiko 3.4.0.20240423
types-python-dateutil 2.9.0.20240316
types-PyYAML 6.0.12.20240311
types-requests 2.31.0.6
types-setuptools 70.0.0.20240524
types-urllib3 1.26.25.14
typing_extensions 4.12.1
tzdata 2024.1
unearth 0.15.4
uri-template 1.3.0
urllib3 1.26.17
virtualenv 20.26.2
watchdog 4.0.1
wcmatch 8.5.2
wcwidth 0.2.13
webcolors 1.13
webencodings 0.5.1
websocket-client 1.8.0
wheel 0.43.0
wrapt 1.16.0
yapf 0.40.2
zipp 3.19.1