If the version of python-notario is < 0.0.13 an error message is given
like "TypeError: validate() got an unexpected keyword argument
'defined_keys'", which is not helpful in figuring
out you've got an incorrect version of python-notario.
This check will avoid that situation by telling the user that they need
to upgrade python-notario before they hit that error.
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
from ansible.plugins.action import ActionBase
+from distutils.version import LooseVersion
try:
from __main__ import display
display.error(msg)
raise SystemExit(msg)
+if LooseVersion(notario.__version__) < LooseVersion("0.0.13"):
+ msg = "The python-notario libary has an incompatible version. Version >= 0.0.13 is needed, current version: %s" % notario.__version__
+ display.error(msg)
+ raise SystemExit(msg)
+
from notario.exceptions import Invalid
from notario.validators import types, chainable, iterables
from notario.decorators import optional