-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: unsupported format string passed to NoneType.__format__ in the docker image #286
Comments
Followed the steps to reproduce this. Running an interactive shell in the container and editing the /home/svc # chaos info extensions
NAME VERSION LICENSE DESCRIPTION
#####################
ExtensionInfo(name='chaostoolkit-reliably', version='0.75.0', summary='Reliably CLI', license='Apache-2.0', author=None, url=None)
chaostoolkit-reliably 0.75.0 Apache-2.0 Reliably CLI
#####################
ExtensionInfo(name='chaostoolkit-addons', version='0.9.0', summary='Addons for your Chaos Toolkit experiments', license=None, author='Chaos Toolkit', url='https://chaostoolkit.org')
Traceback (most recent call last): The info file is iterating over the extensions and wants to print a summary table that includes the licence type extensions = list_extensions()
for extension in extensions:
summary = extension.summary.replace(
"Chaos Toolkit Extension for ", ""
)[:50]
click.echo(
fmt.format(
extension.name,
extension.version,
extension.license,
summary,
)
) I have only started learning chaostoolkit in the last few days so I am not sure if it is mandatory for all addons to provide a licence type or not. However if its not mandatory then something like the following in click.echo(
fmt.format(
extension.name,
extension.version,
extension.license or "NONE",
summary,
)
) OUTPUT /home/svc # chaos info extensions
NAME VERSION LICENSE DESCRIPTION
chaostoolkit-reliably 0.75.0 Apache-2.0 Reliably CLI
chaostoolkit-addons 0.9.0 NONE Addons for your Chaos Toolkit experiments Alternatively if licence is a mandatory field for extensions then I would suggest the code should not load extensions when The more intermediate fix for this would be to update the |
… This is to address issue chaostoolkit#286 where a package doesn't specify a licence and causes the info command to fail due to a None type trying to be formated. Signed-off-by: Chris Doyle <uk.chris.doyle+cdsre@gmail.com>
… license which results in the python type being None. This commit will default extentions with no license infor with a value of 'Unkown'. This approach was discussed in chaostoolkit#299 Signed-off-by: Chris Doyle <uk.chris.doyle+cdsre@gmail.com>
…ch results in the python type being None. This commit will default extentions with no license infor with a value of 'Unkown'. This approach was discussed in #299 Signed-off-by: Chris Doyle <uk.chris.doyle+cdsre@gmail.com>
Describe the bug
[A clear and concise description of what the bug is.]
On this page of documentation:
(https://chaostoolkit.org//deployment/k8s/operator/#run-an-experiment-with-specific-extensions)
It's said "For instance, to install the Chaos Toolkit Kubernetes extension, create a Dockerfile like this. And the docker file is provided.
After building the image from this docker file and run this command (as it is mentioned in the doc):
docker run --rm -it my/chaostoolkit info extensions
I got the exception:
Traceback (most recent call last):
File "/usr/local/bin/chaos", line 8, in
sys.exit(cli())
^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/chaostoolkit/cli.py", line 554, in info
fmt.format(
TypeError: unsupported format string passed to NoneType.format
To Reproduce
Steps to reproduce the behavior.
Just follow the instruction from this section of the doc:
https://chaostoolkit.org//deployment/k8s/operator/#run-an-experiment-with-specific-extensions
Expected behavior
The list of extensions will be displayed.
Additional context
By the way, the provided dockerfile seems incorrect because there is no kubernetes extension inside it. But according to the above description it should be the case.
The text was updated successfully, but these errors were encountered: