We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
instead of raising a proper Exception(), a string is thrown here https://github.com/fortinet-ansible-dev/ansible-galaxy-fortios-collection/blame/1aeb9fa6dfd24b3c9d9d8b95c29b8a6953854abe/plugins/module_utils/fortios/fortios.py#L108
if len(seg) != 3: raise "Invalid fortios system version number: " + version + ". Should be of format [major].[minor].[patch]"
addditionally, in https://github.com/fortinet-ansible-dev/ansible-galaxy-fortios-collection/blob/main/plugins/module_utils/fortios/fortios.py#L114, a BaseException is thrown which is not how Exception handling in python is done. You should not raise BaseException but Exception or (even better) custom subclass of the builtin Exception class:
if len(one_range) != 2: raise BaseException("Incorrect version range, expecting [start, end]: " + str(one_range))
Thank you, Jan
The text was updated successfully, but these errors were encountered:
Hi @jweiher
Thank you so much for your advice! We'll improve the code you mentioned in the next release.
Thanks, Jie
Sorry, something went wrong.
We just released Ansible FOS 2.3.7. and improved our code according your suggestion, many thanks!
Thanks, Maxx
No branches or pull requests
Hi,
instead of raising a proper Exception(), a string is thrown here https://github.com/fortinet-ansible-dev/ansible-galaxy-fortios-collection/blame/1aeb9fa6dfd24b3c9d9d8b95c29b8a6953854abe/plugins/module_utils/fortios/fortios.py#L108
addditionally, in https://github.com/fortinet-ansible-dev/ansible-galaxy-fortios-collection/blob/main/plugins/module_utils/fortios/fortios.py#L114, a BaseException is thrown which is not how Exception handling in python is done. You should not raise BaseException but Exception or (even better) custom subclass of the builtin Exception class:
Thank you,
Jan
The text was updated successfully, but these errors were encountered: